DanielSwift commited on
Commit
e0845f9
·
1 Parent(s): 3ec3ee6

Add diagnostic information for troubleshooting

Browse files
Files changed (1) hide show
  1. app.py +14 -2
app.py CHANGED
@@ -7,6 +7,18 @@ Provides an interface to analyze, verify, and construct proofs using the SFOSR f
7
  import gradio as gr
8
  import json
9
  import os
 
 
 
 
 
 
 
 
 
 
 
 
10
  from sfosr_core.sfosr_system import SFOSRSystem # Assuming sfosr_system.py is in sfosr_core
11
 
12
  # --- Configuration ---
@@ -14,7 +26,7 @@ DB_PATH = "sfosr.db" # Assumes the database is in the root directory
14
 
15
  # Check if DB exists, otherwise handle appropriately (e.g., log an error)
16
  if not os.path.exists(DB_PATH):
17
- print(f"Error: Database file not found at {DB_PATH}. Please ensure it exists.")
18
  # In a real scenario, you might want to exit or provide a way to upload/create it.
19
  sfosr_instance = None # Indicate that the system is not ready
20
  else:
@@ -23,7 +35,7 @@ else:
23
  sfosr_instance = SFOSRSystem(db_path=DB_PATH)
24
  print("SFOSR System initialized successfully.")
25
  except Exception as e:
26
- print(f"Error initializing SFOSR System: {e}")
27
  sfosr_instance = None # Indicate that the system failed to initialize
28
 
29
  # --- Helper Functions for Gradio ---
 
7
  import gradio as gr
8
  import json
9
  import os
10
+ import sys
11
+ import traceback
12
+
13
+ # --- Basic diagnostics ---
14
+ print("==== Starting SFOSR Gradio App ====")
15
+ print(f"Working directory: {os.getcwd()}")
16
+ print(f"Python version: {sys.version}")
17
+ print(f"Files in directory: {os.listdir('.')}")
18
+ print(f"sfosr_core directory exists: {os.path.exists('sfosr_core')}")
19
+ if os.path.exists('sfosr_core'):
20
+ print(f"Files in sfosr_core: {os.listdir('sfosr_core')}")
21
+
22
  from sfosr_core.sfosr_system import SFOSRSystem # Assuming sfosr_system.py is in sfosr_core
23
 
24
  # --- Configuration ---
 
26
 
27
  # Check if DB exists, otherwise handle appropriately (e.g., log an error)
28
  if not os.path.exists(DB_PATH):
29
+ print(f"Error: Database file not found at {DB_PATH}. Current working directory: {os.getcwd()}, Files in directory: {os.listdir()}")
30
  # In a real scenario, you might want to exit or provide a way to upload/create it.
31
  sfosr_instance = None # Indicate that the system is not ready
32
  else:
 
35
  sfosr_instance = SFOSRSystem(db_path=DB_PATH)
36
  print("SFOSR System initialized successfully.")
37
  except Exception as e:
38
+ print(f"Error initializing SFOSR System: {e}\nTraceback: {traceback.format_exc()}")
39
  sfosr_instance = None # Indicate that the system failed to initialize
40
 
41
  # --- Helper Functions for Gradio ---