bluenevus commited on
Commit
50ac72f
·
verified ·
1 Parent(s): 28fb4c3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
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 is installed and accessible")
31
- except subprocess.CalledProcessError:
32
- print("Error: Graphviz is not accessible")
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.")