parkerjj commited on
Commit
a29b172
·
1 Parent(s): a65e7e5

Change to Gradio

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -20,11 +20,11 @@ async def api_bbb(request: TextRequest):
20
  result = request.text + 'bbb'
21
  return {"result": result}
22
 
23
- # Gradio 假界面,保持 app.py 有一个 Gradio 接口
24
  def fake_interface():
25
  return "Gradio Interface Placeholder"
26
 
27
- # 将 FastAPI app 作为 Gradio 的后端
28
- app = gr.mount_gradio_app(app, gr.Interface(fn=fake_interface, inputs=None, outputs="text"))
29
 
30
  # 注意:Hugging Face Spaces 会自动运行此 app 文件,因此不需要 __main__ 入口。
 
20
  result = request.text + 'bbb'
21
  return {"result": result}
22
 
23
+ # Gradio 假界面,仅用于通过 Hugging Face Spaces 部署
24
  def fake_interface():
25
  return "Gradio Interface Placeholder"
26
 
27
+ # 将 Gradio 应用挂载到 "/gradio" 路径
28
+ app = gr.mount_gradio_app(app, gr.Interface(fn=fake_interface, inputs=None, outputs="text"), path="/gradio")
29
 
30
  # 注意:Hugging Face Spaces 会自动运行此 app 文件,因此不需要 __main__ 入口。