shivanis14 commited on
Commit
837d944
·
verified ·
1 Parent(s): 7be32de

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -370,7 +370,7 @@ class ChatManager:
370
  st.session_state.awaiting_image_upload = True
371
 
372
  # Only show message and uploader if waiting for image upload
373
- while st.session_state.awaiting_image_upload:
374
  with st.chat_message("assistant"):
375
  st.markdown(f"Please provide images of the product since {len(st.session_state.similar_products)} similar products found in our database")
376
  # Append the message to session state for chat history
@@ -386,8 +386,11 @@ class ChatManager:
386
  st.session_state.uploaded_files = uploaded_files
387
  st.session_state.awaiting_image_upload = False
388
  return f"{len(uploaded_files)} images uploaded for analysis.", "no success"
389
- #else:
390
- # return "Waiting for images!", "no success"
 
 
 
391
 
392
  @staticmethod
393
  def _handle_product_url():
 
370
  st.session_state.awaiting_image_upload = True
371
 
372
  # Only show message and uploader if waiting for image upload
373
+ if st.session_state.awaiting_image_upload:
374
  with st.chat_message("assistant"):
375
  st.markdown(f"Please provide images of the product since {len(st.session_state.similar_products)} similar products found in our database")
376
  # Append the message to session state for chat history
 
386
  st.session_state.uploaded_files = uploaded_files
387
  st.session_state.awaiting_image_upload = False
388
  return f"{len(uploaded_files)} images uploaded for analysis.", "no success"
389
+ else:
390
+ # Show a temporary message until files are uploaded
391
+ st.info("Waiting for images to be uploaded.")
392
+ st.stop() # Prevent further execution until user interacts
393
+ #return "Waiting for images!", "no success"
394
 
395
  @staticmethod
396
  def _handle_product_url():