File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed
src/transformers/models/qwen2_5_omni Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -195,16 +195,17 @@ def __call__(
195
195
if not isinstance (text , list ):
196
196
text = [text ]
197
197
198
- text = self .replace_multimodal_special_tokens (
199
- text ,
200
- audio_lengths ,
201
- image_grid_thw ,
202
- video_grid_thw ,
203
- video_second_per_grid = video_second_per_grid ,
204
- use_audio_in_video = use_audio_in_video ,
205
- position_id_per_seconds = position_id_per_seconds ,
206
- seconds_per_chunk = seconds_per_chunk ,
207
- )
198
+ if images is not None or videos is not None or audio is not None :
199
+ text = self .replace_multimodal_special_tokens (
200
+ text ,
201
+ audio_lengths ,
202
+ image_grid_thw ,
203
+ video_grid_thw ,
204
+ video_second_per_grid = video_second_per_grid ,
205
+ use_audio_in_video = use_audio_in_video ,
206
+ position_id_per_seconds = position_id_per_seconds ,
207
+ seconds_per_chunk = seconds_per_chunk ,
208
+ )
208
209
209
210
texts_inputs = self .tokenizer (text , ** output_kwargs ["text_kwargs" ])
210
211
You can’t perform that action at this time.
0 commit comments