Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -175,7 +175,7 @@ def main():
|
|
175 |
st.text_area(f"Source {i + 1} - Page {source['page']}", value=source["content"], height=100)
|
176 |
|
177 |
with st.form(key="question_form"):
|
178 |
-
message = st.text_input("Ask a question", key="
|
179 |
submit_button = st.form_submit_button(label="Submit")
|
180 |
|
181 |
if submit_button:
|
@@ -186,9 +186,10 @@ def main():
|
|
186 |
st.session_state['chat_history'] = chat_history
|
187 |
st.session_state['sources'] = sources
|
188 |
|
189 |
-
# Clear the input
|
190 |
-
#
|
191 |
-
st.
|
192 |
|
193 |
if __name__ == "__main__":
|
194 |
main()
|
|
|
|
175 |
st.text_area(f"Source {i + 1} - Page {source['page']}", value=source["content"], height=100)
|
176 |
|
177 |
with st.form(key="question_form"):
|
178 |
+
message = st.text_input("Ask a question", key="message_input")
|
179 |
submit_button = st.form_submit_button(label="Submit")
|
180 |
|
181 |
if submit_button:
|
|
|
186 |
st.session_state['chat_history'] = chat_history
|
187 |
st.session_state['sources'] = sources
|
188 |
|
189 |
+
# Clear the input field and rerun the app to refresh the display
|
190 |
+
st.session_state['message_input'] = "" # Clear the input field
|
191 |
+
st.rerun() # Force a rerun to update the UI
|
192 |
|
193 |
if __name__ == "__main__":
|
194 |
main()
|
195 |
+
|