Ankit93 commited on
Commit
76b62e6
·
verified ·
1 Parent(s): 1234b00

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -115,9 +115,6 @@ st.markdown("""
115
  """, unsafe_allow_html=True)
116
 
117
  # Chat input and processing
118
- if "user_input" not in st.session_state:
119
- st.session_state["user_input"] = ""
120
-
121
  user_input = st.text_input("Type your message here...", key="user_input", label_visibility="collapsed")
122
 
123
  # If there's input, process it
@@ -140,6 +137,6 @@ if user_input:
140
  # Display the user input and response
141
  st.chat_message("user").write(user_input)
142
  st.chat_message("assistant").write(response_text)
143
-
144
- # Reset the user input by updating session_state
145
- st.session_state.user_input = ""
 
115
  """, unsafe_allow_html=True)
116
 
117
  # Chat input and processing
 
 
 
118
  user_input = st.text_input("Type your message here...", key="user_input", label_visibility="collapsed")
119
 
120
  # If there's input, process it
 
137
  # Display the user input and response
138
  st.chat_message("user").write(user_input)
139
  st.chat_message("assistant").write(response_text)
140
+
141
+ # Reset `user_input` variable instead of session state directly
142
+ user_input = ""