mirror of
https://github.com/huggingface/transformers.git
synced 2025-10-20 17:13:56 +08:00
Fix qwen-omni processor text only mode (#40336)
* Fix qwen-omni processor text only mode * remove try except --------- Co-authored-by: yuekaiz <yuekaiz@mgmt1-login.cm.cluster>
This commit is contained in:
@ -195,16 +195,17 @@ class Qwen2_5OmniProcessor(ProcessorMixin):
|
||||
if not isinstance(text, list):
|
||||
text = [text]
|
||||
|
||||
text = self.replace_multimodal_special_tokens(
|
||||
text,
|
||||
audio_lengths,
|
||||
image_grid_thw,
|
||||
video_grid_thw,
|
||||
video_second_per_grid=video_second_per_grid,
|
||||
use_audio_in_video=use_audio_in_video,
|
||||
position_id_per_seconds=position_id_per_seconds,
|
||||
seconds_per_chunk=seconds_per_chunk,
|
||||
)
|
||||
if images is not None or videos is not None or audio is not None:
|
||||
text = self.replace_multimodal_special_tokens(
|
||||
text,
|
||||
audio_lengths,
|
||||
image_grid_thw,
|
||||
video_grid_thw,
|
||||
video_second_per_grid=video_second_per_grid,
|
||||
use_audio_in_video=use_audio_in_video,
|
||||
position_id_per_seconds=position_id_per_seconds,
|
||||
seconds_per_chunk=seconds_per_chunk,
|
||||
)
|
||||
|
||||
texts_inputs = self.tokenizer(text, **output_kwargs["text_kwargs"])
|
||||
|
||||
|
Reference in New Issue
Block a user