Spaces:
Running
Running
Change to Gradio
Browse files
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
|
24 |
def fake_interface():
|
25 |
return "Gradio Interface Placeholder"
|
26 |
|
27 |
-
# 将
|
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__ 入口。
|