SaileshSivan commited on
Commit
43eccc5
·
1 Parent(s): 3fe0940

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -92,14 +92,21 @@ with st.form(key='my_form'):
92
  submit = st.form_submit_button("Submit")
93
 
94
 
 
 
 
95
  # If the "Ask" button is clicked
96
  if submit:
 
 
 
 
97
  # Display loading message while processing
98
  with st.spinner("Analyzing..."):
99
  response = get_chatmodel_response(input_question)
100
 
101
  if response is not None:
102
- # st.subheader("Here you go,")
103
  st.write(response)
104
  else:
105
  st.subheader("Error: Unable to get response. Please try again later.")
 
92
  submit = st.form_submit_button("Submit")
93
 
94
 
95
+ # Create an empty container for the response
96
+ response_container = st.empty()
97
+
98
  # If the "Ask" button is clicked
99
  if submit:
100
+
101
+ # Clear the previous response
102
+ response_container.empty()
103
+
104
  # Display loading message while processing
105
  with st.spinner("Analyzing..."):
106
  response = get_chatmodel_response(input_question)
107
 
108
  if response is not None:
109
+
110
  st.write(response)
111
  else:
112
  st.subheader("Error: Unable to get response. Please try again later.")