Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -397,8 +397,8 @@ class ChatManager:
|
|
397 |
else:
|
398 |
# Show a temporary message until files are uploaded
|
399 |
print(f"DEBUG: No uploaded files!")
|
400 |
-
|
401 |
-
#st.stop()
|
402 |
return "Waiting for images to be uploaded!", "no success"
|
403 |
|
404 |
@staticmethod
|
@@ -470,11 +470,12 @@ def main():
|
|
470 |
print(f"DEBUG - Calling process_response with user_input : {user_input}")
|
471 |
response, status = ChatManager.process_response(user_input)
|
472 |
print(f"DEBUG - response from process_response is {response}")
|
473 |
-
|
474 |
-
with st.chat_message("assistant"):
|
475 |
-
st.markdown(response)
|
476 |
-
st.session_state.messages.append({"role": "assistant", "content": response})
|
477 |
|
|
|
|
|
|
|
|
|
|
|
478 |
if status == "success":
|
479 |
SessionState.initialize() # Reset states for next product
|
480 |
|
@@ -484,7 +485,8 @@ def main():
|
|
484 |
for key in keys_to_delete:
|
485 |
del st.session_state[key]
|
486 |
st.session_state.welcome_msg = "What product would you like me to analyze next?"
|
487 |
-
|
|
|
488 |
print("Re-running...")
|
489 |
st.experimental_rerun()
|
490 |
else:
|
|
|
397 |
else:
|
398 |
# Show a temporary message until files are uploaded
|
399 |
print(f"DEBUG: No uploaded files!")
|
400 |
+
st.info("Waiting for images to be uploaded.")
|
401 |
+
#st.stop()
|
402 |
return "Waiting for images to be uploaded!", "no success"
|
403 |
|
404 |
@staticmethod
|
|
|
470 |
print(f"DEBUG - Calling process_response with user_input : {user_input}")
|
471 |
response, status = ChatManager.process_response(user_input)
|
472 |
print(f"DEBUG - response from process_response is {response}")
|
|
|
|
|
|
|
|
|
473 |
|
474 |
+
if "Waiting for images to be uploaded" not in response:
|
475 |
+
with st.chat_message("assistant"):
|
476 |
+
st.markdown(response)
|
477 |
+
st.session_state.messages.append({"role": "assistant", "content": response})
|
478 |
+
|
479 |
if status == "success":
|
480 |
SessionState.initialize() # Reset states for next product
|
481 |
|
|
|
485 |
for key in keys_to_delete:
|
486 |
del st.session_state[key]
|
487 |
st.session_state.welcome_msg = "What product would you like me to analyze next?"
|
488 |
+
|
489 |
+
|
490 |
print("Re-running...")
|
491 |
st.experimental_rerun()
|
492 |
else:
|