AI-ANK commited on
Commit
6946f01
1 Parent(s): 9d46d12

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -117,8 +117,8 @@ def create_chat_engine(img_desc, api_key):
117
  def clear_chat():
118
  if "messages" in st.session_state:
119
  del st.session_state.messages
120
- if "image_file" in st.session_state:
121
- del st.session_state.image_file
122
 
123
  # Callback function to clear the chat when a new image is uploaded
124
  def on_image_upload():
@@ -196,7 +196,7 @@ else:
196
  st.markdown(user_input)
197
 
198
  # Call the chat engine to get the response if an image has been uploaded
199
- if image_file and user_input:
200
  try:
201
  with st.spinner('Waiting for the chat engine to respond...'):
202
  # Get the response from your chat engine
 
117
  def clear_chat():
118
  if "messages" in st.session_state:
119
  del st.session_state.messages
120
+ if "image_data" in st.session_state:
121
+ del st.session_state.image_data
122
 
123
  # Callback function to clear the chat when a new image is uploaded
124
  def on_image_upload():
 
196
  st.markdown(user_input)
197
 
198
  # Call the chat engine to get the response if an image has been uploaded
199
+ if image_data and user_input:
200
  try:
201
  with st.spinner('Waiting for the chat engine to respond...'):
202
  # Get the response from your chat engine