DerYur commited on
Commit
fa6a100
·
verified ·
1 Parent(s): 498164b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -9
app.py CHANGED
@@ -19,15 +19,16 @@ if not os.path.exists(CODE_DIR):
19
  "git", "clone", "--depth", "1", "--branch", GITHUB_BRANCH, repo_url, CODE_DIR
20
  ], check=True)
21
 
22
- # Final path to Streamlit entry point
23
- streamlit_script = os.path.join(CODE_DIR, "app.py")
24
- if not os.path.exists(streamlit_script):
25
  raise FileNotFoundError("❌ hidden_code/app.py not found")
26
 
27
- # Replace current process with Streamlit (foreground!)
28
- os.execvp("streamlit", [
29
- "streamlit", "run", streamlit_script,
30
- "--server.port=7860",
31
- "--server.headless=true",
32
- "--server.address=0.0.0.0"
33
  ])
 
 
19
  "git", "clone", "--depth", "1", "--branch", GITHUB_BRANCH, repo_url, CODE_DIR
20
  ], check=True)
21
 
22
+ # Final path to FastAPI entry point
23
+ 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
28
+ os.execvp("uvicorn", [
29
+ "uvicorn", "app:app",
30
+ "--host", "0.0.0.0",
31
+ "--port", "7860",
32
+ "--reload"
33
  ])
34
+