Spaces:
Paused
Paused
Update app.py
Browse files
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
|
| 23 |
-
|
| 24 |
-
if not os.path.exists(
|
| 25 |
raise FileNotFoundError("❌ hidden_code/app.py not found")
|
| 26 |
|
| 27 |
-
#
|
| 28 |
-
os.execvp("
|
| 29 |
-
"
|
| 30 |
-
"--
|
| 31 |
-
"--
|
| 32 |
-
"--
|
| 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 |
+
|