import gradio as gr def parse_spatial(text): # 在这里添加您的文本解析逻辑 return f"[Parsed Spatial Info] {text.upper()}" # 创建 Gradio 接口,并指定 API 名称 demo = gr.Interface( fn=parse_spatial, inputs=gr.Textbox(lines=2, placeholder="Enter your spatial description here..."), outputs="text", title="Spatial Parser Demo", description="Enter a spatial description and receive the parsed output.", api_name="/predict" ) # 启动应用 if __name__ == "__main__": demo.launch()