You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
anaconda3/envs/llamafact/lib/python3.10/site-packages/transformers/models/qwen2_vl/processing_qwen2_vl.py", line 143, in __call__
"<|image_pad|>", "<|placeholder|>" * (image_grid_thw[index].prod() // merge_length), 1
IndexError: index 1 is out of bounds for dimension 0 with size 1
However, this is due to the wrong batching setting, i.e., the bz of image and text are inconsistent. By fixing the batching setting, the error can be fixed.
IndexError Traceback (most recent call last)
Cell In[1], line 41
37 text = processor.apply_chat_template(
38 messages, tokenize=False, add_generation_prompt=True
39 )
40 image_inputs, video_inputs = process_vision_info(messages)
---> 41 inputs = processor(
42 text=[text],
43 images=image_inputs,
44 videos=video_inputs,
45 padding=True,
46 return_tensors="pt",
47 )
48 inputs = inputs.to("cuda")
49 # Inference: Generation of the output
File ~/miniconda3/lib/python3.12/site-packages/transformers/models/qwen2_vl/processing_qwen2_vl.py:137, in Qwen2VLProcessor.call(self, images, text, videos, **kwargs)
134 for i in range(len(text)):
135 while "<|image_pad|>" in text[i]:
136 text[i] = text[i].replace(
--> 137 "<|image_pad|>", "<|placeholder|>" * (image_grid_thw[index].prod() // merge_length), 1
138 )
139 index = 1
140 text[i] = text[i].replace("<|placeholder|>", "<|image_pad|>")
IndexError: index 1 is out of bounds for dimension 0 with size 1
The text was updated successfully, but these errors were encountered: