Spaces:
Sleeping
Sleeping
Commit
·
c2d5266
1
Parent(s):
682a315
Update app.py
Browse files
app.py
CHANGED
|
@@ -45,7 +45,7 @@ if 'flowmessages' not in st.session_state:
|
|
| 45 |
]
|
| 46 |
|
| 47 |
# Streamlit UI
|
| 48 |
-
with st.form(key='my_form'):
|
| 49 |
st.markdown(
|
| 50 |
"""
|
| 51 |
<style>
|
|
@@ -69,12 +69,20 @@ with st.form(key='my_form'):
|
|
| 69 |
|
| 70 |
submit = st.form_submit_button("Submit")
|
| 71 |
|
| 72 |
-
# If the "
|
| 73 |
if submit:
|
| 74 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
|
| 76 |
if response is not None:
|
| 77 |
-
|
| 78 |
st.write(response)
|
| 79 |
else:
|
| 80 |
-
st.subheader("Error: Unable to get response. Please try again later.")
|
|
|
|
| 45 |
]
|
| 46 |
|
| 47 |
# Streamlit UI
|
| 48 |
+
with st.form(key='my_form',clear_on_submit=True):
|
| 49 |
st.markdown(
|
| 50 |
"""
|
| 51 |
<style>
|
|
|
|
| 69 |
|
| 70 |
submit = st.form_submit_button("Submit")
|
| 71 |
|
| 72 |
+
# If the "Submit" button is clicked
|
| 73 |
if submit:
|
| 74 |
+
|
| 75 |
+
|
| 76 |
+
# Display loading message while processing
|
| 77 |
+
with st.spinner("Analyzing..."):
|
| 78 |
+
st.header(":blue[You]", divider=True)
|
| 79 |
+
st.caption(input_question)
|
| 80 |
+
|
| 81 |
+
st.header("Sisi", divider=True)
|
| 82 |
+
response = get_chatmodel_response(input_question)
|
| 83 |
|
| 84 |
if response is not None:
|
| 85 |
+
|
| 86 |
st.write(response)
|
| 87 |
else:
|
| 88 |
+
st.subheader("Error: Unable to get response. Please try again later.")
|