Spaces:
Runtime error
Runtime error
fixex
Browse files
app.py
CHANGED
|
@@ -61,11 +61,13 @@ class CustomModelChat:
|
|
| 61 |
)
|
| 62 |
|
| 63 |
# Handle image input if provided
|
| 64 |
-
image_inputs = []
|
| 65 |
if image is not None:
|
| 66 |
if image.mode != 'RGB':
|
| 67 |
image = image.convert('RGB')
|
| 68 |
-
|
|
|
|
|
|
|
|
|
|
| 69 |
|
| 70 |
# Prepare model inputs
|
| 71 |
model_inputs = self.processor(
|
|
|
|
| 61 |
)
|
| 62 |
|
| 63 |
# Handle image input if provided
|
|
|
|
| 64 |
if image is not None:
|
| 65 |
if image.mode != 'RGB':
|
| 66 |
image = image.convert('RGB')
|
| 67 |
+
# Create a list of None for previous turns and add the current image
|
| 68 |
+
image_inputs = [None] * (len(messages) - 1) + [image]
|
| 69 |
+
else:
|
| 70 |
+
image_inputs = None
|
| 71 |
|
| 72 |
# Prepare model inputs
|
| 73 |
model_inputs = self.processor(
|