Shunfeng Zheng commited on
Commit
69eefd7
·
1 Parent(s): 3a0c26d

Add Streamlit demo

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -20,7 +20,11 @@ if st.button("Submit"):
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}")
 
20
  json={"text": text},
21
  timeout=20
22
  )
23
+ try:
24
+ st.write("Raw response:", response.text)
25
+ result = response.json().get("result", "No result returned.")
26
+ except Exception as e:
27
+ st.error(f"Backend error: {e}\nRaw response: {response.text}")
28
  st.success(f"Parsed Output:\n\n{result}")
29
  except Exception as e:
30
  st.error(f"Backend error: {e}")