ranranrunforit commited on
Commit
5bf6e77
·
verified ·
1 Parent(s): 32f0e70

Update server.py

Browse files
Files changed (1) hide show
  1. server.py +8 -5
server.py CHANGED
@@ -260,11 +260,14 @@ def _startup():
260
 
261
 
262
  def launch():
263
- app.launch(
264
- server_name=os.environ.get("GRADIO_SERVER_NAME", "0.0.0.0"),
265
- server_port=int(os.environ.get("GRADIO_SERVER_PORT", os.environ.get("PORT", "7860"))),
 
 
266
  )
267
-
268
-
269
  if __name__ == "__main__":
270
  launch()
 
 
260
 
261
 
262
  def launch():
263
+ import uvicorn
264
+ uvicorn.run(
265
+ app,
266
+ host=os.environ.get("GRADIO_SERVER_NAME", "0.0.0.0"),
267
+ port=int(os.environ.get("GRADIO_SERVER_PORT", os.environ.get("PORT", "7860"))),
268
  )
269
+
270
+
271
  if __name__ == "__main__":
272
  launch()
273
+