DerYur commited on
Commit
bc14920
·
verified ·
1 Parent(s): b9f403c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -24,10 +24,13 @@ api_script = os.path.join(CODE_DIR, "app.py")
24
  if not os.path.exists(api_script):
25
  raise FileNotFoundError("❌ hidden_code/app.py not found")
26
 
27
- # Run FastAPI with uvicorn (NO --reload)
 
 
28
  os.execvp("uvicorn", [
29
- "uvicorn", "app:app",
30
  "--host", "0.0.0.0",
31
  "--port", "7860"
32
  ])
33
 
 
 
24
  if not os.path.exists(api_script):
25
  raise FileNotFoundError("❌ hidden_code/app.py not found")
26
 
27
+ os.chdir(CODE_DIR) # Change to the hidden_code dir
28
+ os.environ["PYTHONPATH"] = CODE_DIR # Ensure Python can resolve imports
29
+
30
  os.execvp("uvicorn", [
31
+ "uvicorn", "app:app",
32
  "--host", "0.0.0.0",
33
  "--port", "7860"
34
  ])
35
 
36
+