Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -66,7 +66,9 @@ def chat_interface(chatbot, text_query, file):
|
|
66 |
if "<box>" in response:
|
67 |
image_with_boxes = chatbot.draw_boxes(response)
|
68 |
chatbot.clear_memory()
|
69 |
-
|
|
|
|
|
70 |
else:
|
71 |
chatbot.clear_memory()
|
72 |
return [("Qwen-VL_Chat", response)]
|
|
|
66 |
if "<box>" in response:
|
67 |
image_with_boxes = chatbot.draw_boxes(response)
|
68 |
chatbot.clear_memory()
|
69 |
+
# Separate the text and image responses
|
70 |
+
text_response = re.sub(r'<ref>.*?</ref>(?:<box>.*?</box>)*(?:<quad>.*?</quad>)*', '', response).strip()
|
71 |
+
return [("Qwen-VL_Chat", text_response), ("Qwen-VL_Image", image_with_boxes)]
|
72 |
else:
|
73 |
chatbot.clear_memory()
|
74 |
return [("Qwen-VL_Chat", response)]
|