File size: 582 Bytes
7d707d7
1d49548
11a5c67
7d707d7
 
 
 
 
1d49548
7d707d7
 
1d49548
 
7d707d7
 
1d49548
7d707d7
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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}")