shivanis14
commited on
Commit
•
8a72e12
1
Parent(s):
eb70115
Update app.py
Browse files
app.py
CHANGED
@@ -455,7 +455,7 @@ def chatbot_response(image_urls_str):
|
|
455 |
|
456 |
if "http:/" in image_urls_str.lower() or "https:/" in image_urls_str.lower():
|
457 |
# Extract image URL from user input
|
458 |
-
if "," not in
|
459 |
image_urls.append(image_urls_str)
|
460 |
else:
|
461 |
for url in image_urls_str.split(","):
|
@@ -514,13 +514,15 @@ choice = st.radio("Choose an option:", options)
|
|
514 |
# User input
|
515 |
if choice == options[0]:
|
516 |
image_urls_str = st.text_input("Enter image URLs separated by commas")
|
|
|
|
|
517 |
|
518 |
# Display chat messages
|
519 |
for message in st.session_state.messages:
|
520 |
with st.chat_message(message["role"]):
|
521 |
st.markdown(message["content"])
|
522 |
|
523 |
-
if image_urls_str:
|
524 |
# Add user message to chat history
|
525 |
st.session_state.messages.append({"role": "user", "content": image_urls_str})
|
526 |
with st.chat_message("user"):
|
|
|
455 |
|
456 |
if "http:/" in image_urls_str.lower() or "https:/" in image_urls_str.lower():
|
457 |
# Extract image URL from user input
|
458 |
+
if "," not in image_urls_str:
|
459 |
image_urls.append(image_urls_str)
|
460 |
else:
|
461 |
for url in image_urls_str.split(","):
|
|
|
514 |
# User input
|
515 |
if choice == options[0]:
|
516 |
image_urls_str = st.text_input("Enter image URLs separated by commas")
|
517 |
+
else:
|
518 |
+
image_urls_str = ""
|
519 |
|
520 |
# Display chat messages
|
521 |
for message in st.session_state.messages:
|
522 |
with st.chat_message(message["role"]):
|
523 |
st.markdown(message["content"])
|
524 |
|
525 |
+
if image_urls_str != "":
|
526 |
# Add user message to chat history
|
527 |
st.session_state.messages.append({"role": "user", "content": image_urls_str})
|
528 |
with st.chat_message("user"):
|