shivanis14 commited on
Commit
0b92093
·
verified ·
1 Parent(s): 4f1002a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -391,6 +391,8 @@ class ChatManager:
391
  st.session_state.awaiting_image_upload = False
392
  print(f"DEBUG: User uploaded files: {uploaded_files}")
393
  return f"{len(uploaded_files)} images uploaded for analysis.", "no success"
 
 
394
  #else:
395
  # # Show a temporary message until files are uploaded
396
  # print(f"DEBUG: No uploaded files!")
@@ -455,6 +457,7 @@ def main():
455
  # Only show chat input if not awaiting selection
456
  if not selection_in_progress:
457
  user_input = st.chat_input("Enter your message:", key="user_input")
 
458
  if user_input:
459
  # Add user message to chat
460
  st.session_state.messages.append({"role": "user", "content": user_input})
@@ -462,6 +465,7 @@ def main():
462
  st.markdown(user_input)
463
 
464
  # Process response
 
465
  response, status = ChatManager.process_response(user_input)
466
  print(f"DEBUG - response from process_response is {response}")
467
 
@@ -481,6 +485,7 @@ def main():
481
 
482
  #else:
483
  # print(f"DEBUG : st.session_state.awaiting_selection : {st.session_state.awaiting_selection}")
 
484
  st.experimental_rerun()
485
  else:
486
  # Disable chat input while selection is in progress
 
391
  st.session_state.awaiting_image_upload = False
392
  print(f"DEBUG: User uploaded files: {uploaded_files}")
393
  return f"{len(uploaded_files)} images uploaded for analysis.", "no success"
394
+
395
+ return "Waiting for image upload...", "no success"
396
  #else:
397
  # # Show a temporary message until files are uploaded
398
  # print(f"DEBUG: No uploaded files!")
 
457
  # Only show chat input if not awaiting selection
458
  if not selection_in_progress:
459
  user_input = st.chat_input("Enter your message:", key="user_input")
460
+ print(f"DEBUG - user_input : {user_input}")
461
  if user_input:
462
  # Add user message to chat
463
  st.session_state.messages.append({"role": "user", "content": user_input})
 
465
  st.markdown(user_input)
466
 
467
  # Process response
468
+ print(f"DEBUG - Calling process_response with user_input : {user_input}")
469
  response, status = ChatManager.process_response(user_input)
470
  print(f"DEBUG - response from process_response is {response}")
471
 
 
485
 
486
  #else:
487
  # print(f"DEBUG : st.session_state.awaiting_selection : {st.session_state.awaiting_selection}")
488
+ print("Re-running...")
489
  st.experimental_rerun()
490
  else:
491
  # Disable chat input while selection is in progress