Spaces:
Sleeping
Sleeping
Commit
·
57202e4
1
Parent(s):
f2ce899
Update app.py
Browse files
app.py
CHANGED
|
@@ -80,17 +80,17 @@ with st.form(key='my_form'):
|
|
| 80 |
unsafe_allow_html=True
|
| 81 |
)
|
| 82 |
|
| 83 |
-
submit = st.form_submit_button("Submit",
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
|
|
|
| 80 |
unsafe_allow_html=True
|
| 81 |
)
|
| 82 |
|
| 83 |
+
submit = st.form_submit_button("Submit", on_click=get_chatmodel_response, args=(input_question,))
|
| 84 |
+
|
| 85 |
+
|
| 86 |
+
# If the "Ask" button is clicked
|
| 87 |
+
if submit:
|
| 88 |
+
# Display loading message while processing
|
| 89 |
+
with st.spinner("Analyzing..."):
|
| 90 |
+
response = get_chatmodel_response(input_question)
|
| 91 |
+
|
| 92 |
+
if response is not None:
|
| 93 |
+
# st.subheader("Here you go,")
|
| 94 |
+
st.write(response)
|
| 95 |
+
else:
|
| 96 |
+
st.subheader("Error: Unable to get response. Please try again later.")
|