Spaces:
Runtime error
Runtime error
new logic
Browse files
app_v2.py
CHANGED
|
@@ -47,11 +47,12 @@ def bot(history):
|
|
| 47 |
try:
|
| 48 |
image = Image.open(image_path) # Try to open the image using Pillow
|
| 49 |
image_embeds = moondream.encode_image(image)
|
|
|
|
| 50 |
response = moondream.answer_question(image_embeds, last_message, tokenizer)
|
| 51 |
except IOError:
|
| 52 |
response = "Failed to open image. Please check the image path or file permissions."
|
| 53 |
else:
|
| 54 |
-
response =
|
| 55 |
|
| 56 |
history[-1][1] = ""
|
| 57 |
for character in response:
|
|
|
|
| 47 |
try:
|
| 48 |
image = Image.open(image_path) # Try to open the image using Pillow
|
| 49 |
image_embeds = moondream.encode_image(image)
|
| 50 |
+
print(image_embeds.shape)
|
| 51 |
response = moondream.answer_question(image_embeds, last_message, tokenizer)
|
| 52 |
except IOError:
|
| 53 |
response = "Failed to open image. Please check the image path or file permissions."
|
| 54 |
else:
|
| 55 |
+
response = "Please provide an Image to chat."
|
| 56 |
|
| 57 |
history[-1][1] = ""
|
| 58 |
for character in response:
|