Shunfeng Zheng commited on
Commit
eedcbeb
·
1 Parent(s): c03e788

Add Streamlit demo

Browse files
Files changed (1) hide show
  1. app.py +4 -24
app.py CHANGED
@@ -1,26 +1,6 @@
 
1
  import streamlit as st
2
- import requests
3
 
4
- st.title("Spatial Parser Demo")
5
-
6
- # 密码验证
7
- password = st.text_input("Enter access password:", type="password")
8
- if password != "demo1234":
9
- st.warning("Please enter the correct password.")
10
- st.stop()
11
-
12
- # 输入框
13
- text = st.text_area("Enter your spatial description:")
14
-
15
- if st.button("Submit"):
16
- with st.spinner("Calling secure backend..."):
17
- try:
18
- response = requests.post(
19
- "https://dsbb0707-SpatialParse_back.hf.space/predict",
20
- json={"text": text},
21
- timeout=20
22
- )
23
- result = response.json().get("result", "No result returned.")
24
- st.success(f"Parsed Output:\n\n{result}")
25
- except Exception as e:
26
- st.error(f"Backend error: {e}")
 
1
+ # app.py
2
  import streamlit as st
 
3
 
4
+ st.title("Spatial Parse Demo")
5
+ x = st.slider('Select a value')
6
+ st.write(x, 'squared is', x * x)