Spaces:
Running on Zero
Running on Zero
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -1,17 +1,10 @@
|
|
| 1 |
import sys
|
| 2 |
import os
|
| 3 |
-
import uvicorn
|
| 4 |
|
| 5 |
# Add src to python path so neural_archaeology module is found
|
| 6 |
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "src")))
|
| 7 |
|
| 8 |
from backend.main import app
|
| 9 |
-
from fastapi.responses import JSONResponse
|
| 10 |
|
| 11 |
-
#
|
| 12 |
-
|
| 13 |
-
def health_check():
|
| 14 |
-
return JSONResponse(content={"status": "running", "message": "BrainBox API is alive"})
|
| 15 |
-
|
| 16 |
-
if __name__ == "__main__":
|
| 17 |
-
uvicorn.run(app, host="0.0.0.0", port=7860)
|
|
|
|
| 1 |
import sys
|
| 2 |
import os
|
|
|
|
| 3 |
|
| 4 |
# Add src to python path so neural_archaeology module is found
|
| 5 |
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "src")))
|
| 6 |
|
| 7 |
from backend.main import app
|
|
|
|
| 8 |
|
| 9 |
+
# DO NOT call uvicorn.run() here.
|
| 10 |
+
# Hugging Face Spaces automatically finds 'app' and launches it correctly.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|