Skip to content

Commit 54842c8

Browse files
authored
[bugfix] fix qwen3_vl image_list fps (#6696)
1 parent 280adc1 commit 54842c8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

swift/llm/template/template/qwen.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,11 @@ def replace_tag(self, media_type: Literal['image', 'video', 'audio'], index: int
307307
if self.version == 'v3':
308308
kwargs['return_video_metadata'] = True
309309
video = inputs.videos[index]
310-
video, video_kwargs = fetch_video({'video': video}, return_video_sample_fps=True, **kwargs)
310+
video_inputs = {'video': video}
311+
if isinstance(video, list): # image list
312+
from qwen_vl_utils import vision_process
313+
video_inputs['sample_fps'] = vision_process.FPS
314+
video, video_kwargs = fetch_video(video_inputs, return_video_sample_fps=True, **kwargs)
311315
if self.version == 'v2_5':
312316
inputs.mm_processor_kwargs.setdefault('fps', []).append(video_kwargs)
313317
tokens = ['<|vision_start|><|video_pad|><|vision_end|>']

0 commit comments

Comments
 (0)