Lord-Raven commited on
Commit
a426b5f
·
1 Parent(s): d5e6bd8

Messing with fastAPI.

Browse files
Files changed (2) hide show
  1. app.py +7 -2
  2. requirements.txt +1 -0
app.py CHANGED
@@ -81,6 +81,11 @@ gradio_interface = gradio.Interface(
81
  outputs = gradio.Textbox()
82
  )
83
 
84
- app = gradio.mount_gradio_app(app, gradio_interface, path="/gradio")
85
 
86
- gradio_interface.launch()
 
 
 
 
 
 
81
  outputs = gradio.Textbox()
82
  )
83
 
84
+ app.mount("/gradio", gradio.routes.App.create_app(gradio_interface))
85
 
86
+ # app = gradio.mount_gradio_app(app, gradio_interface, path="/gradio")
87
+ # gradio_interface.launch()
88
+
89
+ if __name__ == "__main__":
90
+ import uvicorn
91
+ uvicorn.run(app, host="0.0.0.0", port=8000)
requirements.txt CHANGED
@@ -3,5 +3,6 @@ fastapi==0.88.0
3
  huggingface_hub==0.26.0
4
  json5==0.9.25
5
  numpy
 
6
  optimum[onnxruntime-gpu]==1.24.0
7
  transformers==4.36
 
3
  huggingface_hub==0.26.0
4
  json5==0.9.25
5
  numpy
6
+ uvicorn
7
  optimum[onnxruntime-gpu]==1.24.0
8
  transformers==4.36