Pratham0100 commited on
Commit
4e136b1
·
verified ·
1 Parent(s): b6f24fb

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +2 -9
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
- # Hugging Face Spaces healthcheck requires a 200 OK at the root path
12
- @app.get("/")
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.