Update app.py
Browse files
app.py
CHANGED
|
@@ -22,17 +22,19 @@ import graphviz
|
|
| 22 |
logging.basicConfig(level=logging.INFO)
|
| 23 |
|
| 24 |
# Update PATH
|
| 25 |
-
os.environ['PATH'] += ':/usr/bin'
|
| 26 |
|
| 27 |
# Check Graphviz installation
|
| 28 |
try:
|
| 29 |
-
subprocess.run(['dot', '-V'], check=True, capture_output=True)
|
| 30 |
-
print("Graphviz
|
| 31 |
-
except subprocess.CalledProcessError:
|
| 32 |
-
print("Error
|
| 33 |
except FileNotFoundError:
|
| 34 |
print("Error: Graphviz (dot) is not found in PATH")
|
| 35 |
|
|
|
|
|
|
|
| 36 |
openai.api_key = os.getenv("OPENAI_API_KEY")
|
| 37 |
if not openai.api_key:
|
| 38 |
logging.warning("OPENAI_API_KEY not set. GPT-3.5 model will not be available.")
|
|
|
|
| 22 |
logging.basicConfig(level=logging.INFO)
|
| 23 |
|
| 24 |
# Update PATH
|
| 25 |
+
os.environ['PATH'] += ':/usr/bin:/usr/local/bin'
|
| 26 |
|
| 27 |
# Check Graphviz installation
|
| 28 |
try:
|
| 29 |
+
result = subprocess.run(['dot', '-V'], check=True, capture_output=True, text=True)
|
| 30 |
+
print(f"Graphviz version: {result.stdout}")
|
| 31 |
+
except subprocess.CalledProcessError as e:
|
| 32 |
+
print(f"Error running dot: {e}")
|
| 33 |
except FileNotFoundError:
|
| 34 |
print("Error: Graphviz (dot) is not found in PATH")
|
| 35 |
|
| 36 |
+
print(f"Current PATH: {os.environ['PATH']}")
|
| 37 |
+
|
| 38 |
openai.api_key = os.getenv("OPENAI_API_KEY")
|
| 39 |
if not openai.api_key:
|
| 40 |
logging.warning("OPENAI_API_KEY not set. GPT-3.5 model will not be available.")
|