Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -3,8 +3,6 @@ import streamlit as st
|
|
3 |
import requests
|
4 |
import re
|
5 |
from dotenv import load_dotenv
|
6 |
-
from PIL import Image
|
7 |
-
from io import BytesIO
|
8 |
import tempfile
|
9 |
|
10 |
# Load environment variables (for FLOWISE_API token)
|
@@ -51,11 +49,10 @@ if st.button("Generate Diagram"):
|
|
51 |
with open(temp_file, "w") as f:
|
52 |
f.write(python_code)
|
53 |
|
54 |
-
# Execute the code
|
55 |
try:
|
56 |
exec(open(temp_file).read())
|
57 |
-
|
58 |
-
diagram_path = os.path.join(tmpdirname, "WordPress_Architecture.png")
|
59 |
|
60 |
# Display the generated image
|
61 |
if os.path.exists(diagram_path):
|
|
|
3 |
import requests
|
4 |
import re
|
5 |
from dotenv import load_dotenv
|
|
|
|
|
6 |
import tempfile
|
7 |
|
8 |
# Load environment variables (for FLOWISE_API token)
|
|
|
49 |
with open(temp_file, "w") as f:
|
50 |
f.write(python_code)
|
51 |
|
52 |
+
# Execute the code and look for 'diagram.jpg'
|
53 |
try:
|
54 |
exec(open(temp_file).read())
|
55 |
+
diagram_path = os.path.join(tmpdirname, "diagram.jpg")
|
|
|
56 |
|
57 |
# Display the generated image
|
58 |
if os.path.exists(diagram_path):
|