Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions src/transformers/models/qwen2_5_omni/processing_qwen2_5_omni.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
Processor class for Qwen2.5Omni.
"""

import logging
import re

import numpy as np
Expand Down Expand Up @@ -301,27 +300,6 @@ def _iter():

return list(_iter())

def apply_chat_template(self, conversations, chat_template=None, **kwargs):
is_batched = False
if isinstance(conversations[0], dict):
conversations = [conversations]
is_batched = True

for conversation in conversations:
if (
conversation[0]["role"] != "system"
or conversation[0]["content"][0]["text"]
!= "You are Qwen, a virtual human developed by the Qwen Team, Alibaba Group, capable of perceiving auditory and visual inputs, as well as generating text and speech."
):
logging.warning(
"System prompt modified, audio output may not work as expected. "
+ "Audio output mode only works when using default system prompt 'You are Qwen, a virtual human developed by the Qwen Team, Alibaba Group, capable of perceiving auditory and visual inputs, as well as generating text and speech.'"
)
Comment on lines -316 to -319
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I hate this warning as well haha, couldn't convince qwen team to delete at model addition time 🫠

Now that it's maintained by us, ig we can decide what to do with it

if is_batched:
conversations = conversations[0]

return super().apply_chat_template(conversations, chat_template, **kwargs)

def post_process_image_text_to_text(self, generated_outputs, skip_special_tokens=True, **kwargs):
"""
Post-process the output of a vlm to decode the text.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,9 +318,6 @@ def _iter():

return list(_iter())

def apply_chat_template(self, conversations, chat_template=None, **kwargs):
return super().apply_chat_template(conversations, chat_template, **kwargs)

def post_process_image_text_to_text(self, generated_outputs, skip_special_tokens=True, **kwargs):
"""
Post-process the output of a vlm to decode the text.
Expand Down Expand Up @@ -392,5 +389,8 @@ def model_input_names(self):
)
)

def apply_chat_template(self, conversations, chat_template=None, **kwargs):
return super().apply_chat_template(conversations, chat_template, **kwargs)


__all__ = ["Qwen3OmniMoeProcessor"]
Loading