shivanis14 commited on
Commit
b47d089
·
verified ·
1 Parent(s): b7ead55

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -394,13 +394,11 @@ class ChatManager:
394
  st.session_state.awaiting_image_upload = False
395
  print(f"DEBUG: User uploaded files: {uploaded_files}")
396
  return f"{len(uploaded_files)} images uploaded for analysis.", "no success"
397
-
398
  else:
399
  # Show a temporary message until files are uploaded
400
  st.info("Waiting for images to be uploaded.")
401
  print("Waiting for images to be uploaded!")
402
  st.stop()
403
- return "Waiting for images to be uploaded!", "no success"
404
 
405
  @staticmethod
406
  def _handle_product_url():
@@ -460,9 +458,9 @@ def main():
460
  print(f"Selection in progress ? : {selection_in_progress}")
461
  if not selection_in_progress:
462
  user_input = st.chat_input("Enter your message:", key="user_input")
463
- print(f"DEBUG - user_input : {user_input}")
464
 
465
- if user_input or len(st.session_state.uploaded_files) > 0:
466
  # Add user message to chat
467
  st.session_state.messages.append({"role": "user", "content": user_input})
468
  with st.chat_message("user"):
 
394
  st.session_state.awaiting_image_upload = False
395
  print(f"DEBUG: User uploaded files: {uploaded_files}")
396
  return f"{len(uploaded_files)} images uploaded for analysis.", "no success"
 
397
  else:
398
  # Show a temporary message until files are uploaded
399
  st.info("Waiting for images to be uploaded.")
400
  print("Waiting for images to be uploaded!")
401
  st.stop()
 
402
 
403
  @staticmethod
404
  def _handle_product_url():
 
458
  print(f"Selection in progress ? : {selection_in_progress}")
459
  if not selection_in_progress:
460
  user_input = st.chat_input("Enter your message:", key="user_input")
461
+ print(f"DEBUG - user_input : {user_input} and len(st.session_state.uploaded_files) is {len(st.session_state.uploaded_files)}")
462
 
463
+ if user_input or st.session_state.awaiting_image_upload:
464
  # Add user message to chat
465
  st.session_state.messages.append({"role": "user", "content": user_input})
466
  with st.chat_message("user"):