ar9avg commited on
Commit
63d67f0
·
1 Parent(s): f32a4be
Files changed (2) hide show
  1. pyproject.toml +1 -1
  2. server/app.py +4 -3
pyproject.toml CHANGED
@@ -25,7 +25,7 @@ dependencies = [
25
  ]
26
 
27
  [project.scripts]
28
- serve = "server.app:serve"
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 serve() -> None:
24
- """Entry point for `[project.scripts] serve = 'server.app:serve'`."""
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
- __all__ = ["app", "serve"]
 
 
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()