Spaces:
Sleeping
Sleeping
Commit ·
fa00a96
1
Parent(s): 49cfd07
fix: update server script entry point to use main function
Browse files- pyproject.toml +1 -1
- server/app.py +10 -2
pyproject.toml
CHANGED
|
@@ -12,7 +12,7 @@ dependencies = [
|
|
| 12 |
]
|
| 13 |
|
| 14 |
[project.scripts]
|
| 15 |
-
server = "server.app:
|
| 16 |
|
| 17 |
[build-system]
|
| 18 |
requires = ["setuptools", "wheel"]
|
|
|
|
| 12 |
]
|
| 13 |
|
| 14 |
[project.scripts]
|
| 15 |
+
server = "server.app:main"
|
| 16 |
|
| 17 |
[build-system]
|
| 18 |
requires = ["setuptools", "wheel"]
|
server/app.py
CHANGED
|
@@ -3,7 +3,15 @@
|
|
| 3 |
import sys
|
| 4 |
import os
|
| 5 |
|
| 6 |
-
# allow imports from root
|
| 7 |
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
|
| 8 |
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
import sys
|
| 4 |
import os
|
| 5 |
|
|
|
|
| 6 |
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
|
| 7 |
|
| 8 |
+
import uvicorn
|
| 9 |
+
from app import app
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
def main():
|
| 13 |
+
uvicorn.run(app, host="0.0.0.0", port=7860)
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
if __name__ == "__main__":
|
| 17 |
+
main()
|