SpatialParse / app.py
Shunfeng Zheng
Update app.py
5c8fd42 verified
raw
history blame
651 Bytes
import requests
import streamlit as st
st.title("Spatial Parser Demo")
text = st.text_area("Enter your spatial description:")
if st.button("Submit"):
with st.spinner("Calling backend..."):
try:
response = requests.post(
"https://dsbb0707--spatialparse-gradio.hf.space/run/predict",
json={"data": [text]},
timeout=20
)
st.write("Raw response:", response.text) # 调试信息
result = response.json()["data"][0]
st.success(f"Parsed Output:\n\n{result}")
except Exception as e:
st.error(f"Backend error: {e}")