Haiss123 commited on
Commit
f97665b
·
verified ·
1 Parent(s): 25e97a3

Update detection_api.py

Browse files
Files changed (1) hide show
  1. detection_api.py +6 -7
detection_api.py CHANGED
@@ -746,10 +746,9 @@ async def cleanup_old_files(hours: int = 24):
746
 
747
  if __name__ == "__main__":
748
  import os
749
- uvicorn.run(
750
- "main:app",
751
- host="0.0.0.0",
752
- port=int(os.environ.get("PORT", 7860)),
753
- reload=False,
754
- log_level="info"
755
- )
 
746
 
747
  if __name__ == "__main__":
748
  import os
749
+ port = int(os.environ.get("PORT", 7860))
750
+ options = {
751
+ "bind": f"0.0.0.0:{port}",
752
+ "workers": 2,
753
+ }
754
+ StandaloneApplication(app, options).run()