Spaces:
Sleeping
Sleeping
fix
Browse files- pyproject.toml +1 -1
- server/app.py +4 -3
pyproject.toml
CHANGED
|
@@ -25,7 +25,7 @@ dependencies = [
|
|
| 25 |
]
|
| 26 |
|
| 27 |
[project.scripts]
|
| 28 |
-
|
| 29 |
|
| 30 |
[project.urls]
|
| 31 |
Homepage = "https://huggingface.co/spaces/ar9av/sql-agent-openenv"
|
|
|
|
| 25 |
]
|
| 26 |
|
| 27 |
[project.scripts]
|
| 28 |
+
server = "server.app:main"
|
| 29 |
|
| 30 |
[project.urls]
|
| 31 |
Homepage = "https://huggingface.co/spaces/ar9av/sql-agent-openenv"
|
server/app.py
CHANGED
|
@@ -20,8 +20,8 @@ if _BACKEND not in sys.path:
|
|
| 20 |
from main import app # noqa: E402 (FastAPI application)
|
| 21 |
|
| 22 |
|
| 23 |
-
def
|
| 24 |
-
"""Entry point for `[project.scripts]
|
| 25 |
import uvicorn
|
| 26 |
|
| 27 |
port = int(os.environ.get("PORT", os.environ.get("GRADIO_SERVER_PORT", "7860")))
|
|
@@ -33,4 +33,5 @@ def serve() -> None:
|
|
| 33 |
)
|
| 34 |
|
| 35 |
|
| 36 |
-
|
|
|
|
|
|
| 20 |
from main import app # noqa: E402 (FastAPI application)
|
| 21 |
|
| 22 |
|
| 23 |
+
def main() -> None:
|
| 24 |
+
"""Entry point for `[project.scripts] server = 'server.app:main'`."""
|
| 25 |
import uvicorn
|
| 26 |
|
| 27 |
port = int(os.environ.get("PORT", os.environ.get("GRADIO_SERVER_PORT", "7860")))
|
|
|
|
| 33 |
)
|
| 34 |
|
| 35 |
|
| 36 |
+
if __name__ == "__main__":
|
| 37 |
+
main()
|