sebbe60 commited on
Commit
2ca4df9
·
verified ·
1 Parent(s): 186f80a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -115,11 +115,15 @@ if spaces is not None:
115
 
116
  if __name__ == "__main__":
117
  if spaces is not None:
 
118
  platform_status.launch(
119
  server_name="0.0.0.0",
120
  server_port=int(os.getenv("PORT", "7860")),
121
- _app=app,
122
  )
 
 
 
123
  else:
124
  import uvicorn
125
 
 
115
 
116
  if __name__ == "__main__":
117
  if spaces is not None:
118
+ device, detectors, load_errors = load_detectors()
119
  platform_status.launch(
120
  server_name="0.0.0.0",
121
  server_port=int(os.getenv("PORT", "7860")),
122
+ prevent_thread_lock=True,
123
  )
124
+ platform_status.server_app.add_api_route("/health", health, methods=["GET"])
125
+ platform_status.server_app.add_api_route("/v1/detect", detect, methods=["POST"])
126
+ platform_status.block_thread()
127
  else:
128
  import uvicorn
129