SpatialParse / app.py
Shunfeng Zheng
Add Streamlit demo
1d49548
raw
history blame
582 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
)
result = response.json()["data"][0]
st.success(f"Parsed Output:\n\n{result}")
except Exception as e:
st.error(f"Backend error: {e}")