Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -357,10 +357,11 @@ def main():
|
|
357 |
response = f"⚠️ Something went wrong: {e}"
|
358 |
|
359 |
# ✅ Show the response
|
360 |
-
st.markdown(
|
361 |
st.write(response)
|
362 |
|
363 |
-
|
|
|
364 |
|
365 |
# After bot responds, ask for feedback
|
366 |
with st.form(key=f"feedback_form_{len(st.session_state.chat_history)}"):
|
@@ -384,9 +385,10 @@ def main():
|
|
384 |
if len(st.session_state.feedback_log) >= 5:
|
385 |
save_feedback_to_huggingface()
|
386 |
|
387 |
-
# Clear input box automatically
|
388 |
st.rerun()
|
389 |
|
|
|
390 |
if __name__ == "__main__":
|
391 |
load_environment()
|
392 |
main()
|
|
|
357 |
response = f"⚠️ Something went wrong: {e}"
|
358 |
|
359 |
# ✅ Show the response
|
360 |
+
st.markdown("### Answer:")
|
361 |
st.write(response)
|
362 |
|
363 |
+
# Update chat history
|
364 |
+
st.session_state.chat_history.append({"user": user_question, "bot": response})
|
365 |
|
366 |
# After bot responds, ask for feedback
|
367 |
with st.form(key=f"feedback_form_{len(st.session_state.chat_history)}"):
|
|
|
385 |
if len(st.session_state.feedback_log) >= 5:
|
386 |
save_feedback_to_huggingface()
|
387 |
|
388 |
+
# Clear input box automatically after feedback
|
389 |
st.rerun()
|
390 |
|
391 |
+
|
392 |
if __name__ == "__main__":
|
393 |
load_environment()
|
394 |
main()
|