Spaces:
Build error
Build error
Youngger9765
Claude
Happy
commited on
Commit
·
77b7140
1
Parent(s):
efc08f7
fix: correct uvicorn startup path for HuggingFace Spaces
Browse files- Run uvicorn from /app directory instead of /app/backend
- This allows proper Python module imports (backend.*)
- Fixes ModuleNotFoundError in HuggingFace deployment
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
start.sh
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
#!/bin/bash
|
| 2 |
|
| 3 |
-
# Start FastAPI backend in the background
|
| 4 |
-
cd /app
|
| 5 |
|
| 6 |
# Start Next.js frontend on port 7860 (required by Hugging Face)
|
| 7 |
-
cd /app/frontend && npm start -- -p 7860
|
|
|
|
| 1 |
#!/bin/bash
|
| 2 |
|
| 3 |
+
# Start FastAPI backend in the background (run from /app so imports work)
|
| 4 |
+
cd /app && uvicorn backend.main:app --host 0.0.0.0 --port 8000 &
|
| 5 |
|
| 6 |
# Start Next.js frontend on port 7860 (required by Hugging Face)
|
| 7 |
+
cd /app/frontend && npm start -- -p 7860
|