kazutab commited on
Commit
0a9998a
·
verified ·
1 Parent(s): b579f28

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -182,11 +182,12 @@ async def get_frontend_file(filename: str):
182
  # ---------------------------------------------------------
183
  # ZeroGPU REQUIRES a Gradio app to exist, so we mount a dummy one.
184
  @spaces.GPU(duration=120)
185
- def dummy_gpu_task():
186
- pass
187
 
188
  demo = gr.Interface(fn=dummy_gpu_task, inputs="text", outputs="text")
189
  app = gr.mount_gradio_app(app, demo, path="/dummy_gradio")
190
 
191
- # !!!注意!!!
192
- # uvicorn.run は絶対に呼ばないこと。Hugging FaceのGradioランチャーが自動でappを起動します。
 
 
182
  # ---------------------------------------------------------
183
  # ZeroGPU REQUIRES a Gradio app to exist, so we mount a dummy one.
184
  @spaces.GPU(duration=120)
185
+ def dummy_gpu_task(*args, **kwargs):
186
+ return "dummy"
187
 
188
  demo = gr.Interface(fn=dummy_gpu_task, inputs="text", outputs="text")
189
  app = gr.mount_gradio_app(app, demo, path="/dummy_gradio")
190
 
191
+ if __name__ == "__main__":
192
+ import uvicorn
193
+ uvicorn.run(app, host="0.0.0.0", port=7860)