shivanis14 commited on
Commit
09a2492
·
verified ·
1 Parent(s): fb5458d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -307,7 +307,7 @@ class ProductSelector:
307
  for key in keys_to_delete:
308
  del st.session_state[key]
309
  st.session_state.welcome_msg = "What product would you like me to analyze next?"
310
- st.rerun()
311
 
312
  if choice == "None of the above" or msg == "product not found because product information in the db is corrupt":
313
  st.session_state.messages.append(
@@ -330,7 +330,7 @@ class ProductSelector:
330
  with st.chat_message("assistant"):
331
  st.markdown(f"{len(uploaded_files)} images uploaded for analysis.")
332
  st.session_state.uploaded_files = uploaded_files
333
- st.rerun()
334
 
335
  # Prevent further chat input while awaiting selection
336
  return True # Indicates selection is in progress
@@ -470,7 +470,7 @@ def main():
470
 
471
  #else:
472
  # print(f"DEBUG : st.session_state.awaiting_selection : {st.session_state.awaiting_selection}")
473
- st.rerun()
474
  else:
475
  # Disable chat input while selection is in progress
476
  st.chat_input("Please confirm your selection above first...", disabled=True)
@@ -478,7 +478,7 @@ def main():
478
  # Clear chat history button
479
  if st.button("Clear Chat History"):
480
  st.session_state.clear()
481
- st.rerun()
482
 
483
  # Call the wrapper function in Streamlit
484
  if __name__ == "__main__":
 
307
  for key in keys_to_delete:
308
  del st.session_state[key]
309
  st.session_state.welcome_msg = "What product would you like me to analyze next?"
310
+ st.experimental_rerun()
311
 
312
  if choice == "None of the above" or msg == "product not found because product information in the db is corrupt":
313
  st.session_state.messages.append(
 
330
  with st.chat_message("assistant"):
331
  st.markdown(f"{len(uploaded_files)} images uploaded for analysis.")
332
  st.session_state.uploaded_files = uploaded_files
333
+ st.experimental_rerun()
334
 
335
  # Prevent further chat input while awaiting selection
336
  return True # Indicates selection is in progress
 
470
 
471
  #else:
472
  # print(f"DEBUG : st.session_state.awaiting_selection : {st.session_state.awaiting_selection}")
473
+ st.experimental_rerun()
474
  else:
475
  # Disable chat input while selection is in progress
476
  st.chat_input("Please confirm your selection above first...", disabled=True)
 
478
  # Clear chat history button
479
  if st.button("Clear Chat History"):
480
  st.session_state.clear()
481
+ st.experimental_rerun()
482
 
483
  # Call the wrapper function in Streamlit
484
  if __name__ == "__main__":