szymmon commited on
Commit
62733d8
·
1 Parent(s): 9bf607c
Files changed (1) hide show
  1. app.py +4 -2
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
- image_inputs.append([image])
 
 
 
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(