Shunfeng Zheng commited on
Commit
2d8da02
·
verified ·
1 Parent(s): 26f663e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -3
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
- demo = gr.Interface(fn=parse_spatial, inputs="text", outputs="text", allow_flagging="never"
 
 
 
 
 
 
 
8
  )
9
- demo.launch(api_name="predict")
 
 
 
 
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()