Skip to content

Commit a423dac

Browse files
authored
[bugfix] fix image_list qwen2.5-omni (#6122)
1 parent 23cb839 commit a423dac

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

swift/llm/template/template/qwen.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,10 @@ def replace_tag(self, media_type: Literal['image', 'video', 'audio'], index: int
536536
return ['<|audio_start|><|audio_pad|><|audio_end|>']
537537
elif media_type == 'video':
538538
video = inputs.videos[index]
539-
inputs.videos[index] = fetch_video({'video': video}).to(torch.uint8)
539+
_video = fetch_video({'video': video})
540+
if isinstance(_video, torch.Tensor):
541+
_video = _video.to(torch.uint8)
542+
inputs.videos[index] = _video
540543
if self.use_audio_in_video:
541544
import librosa
542545
if video.startswith('http://') or video.startswith('https://'):

0 commit comments

Comments
 (0)