Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 "
|
| 121 |
-
del st.session_state.
|
| 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
|
| 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
|