Spaces:
Build error
Build error
Shunfeng Zheng
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,9 +1,19 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
print("Gradio version:", gr.__version__)
|
| 3 |
|
| 4 |
def parse_spatial(text):
|
|
|
|
| 5 |
return f"[Parsed Spatial Info] {text.upper()}"
|
| 6 |
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
)
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
|
| 3 |
def parse_spatial(text):
|
| 4 |
+
# 在这里添加您的文本解析逻辑
|
| 5 |
return f"[Parsed Spatial Info] {text.upper()}"
|
| 6 |
|
| 7 |
+
# 创建 Gradio 接口,并指定 API 名称
|
| 8 |
+
demo = gr.Interface(
|
| 9 |
+
fn=parse_spatial,
|
| 10 |
+
inputs=gr.Textbox(lines=2, placeholder="Enter your spatial description here..."),
|
| 11 |
+
outputs="text",
|
| 12 |
+
title="Spatial Parser Demo",
|
| 13 |
+
description="Enter a spatial description and receive the parsed output.",
|
| 14 |
+
api_name="/predict"
|
| 15 |
)
|
| 16 |
+
|
| 17 |
+
# 启动应用
|
| 18 |
+
if __name__ == "__main__":
|
| 19 |
+
demo.launch()
|