Skip to content

[fix] Make Qwen2_5OmniProcessor warning a lot less noisy via warning_once#45455

Merged
tomaarsen merged 8 commits intohuggingface:mainfrom
tomaarsen:fix/qwen2_5_omni_noisy_warning
Apr 16, 2026
Merged

[fix] Make Qwen2_5OmniProcessor warning a lot less noisy via warning_once#45455
tomaarsen merged 8 commits intohuggingface:mainfrom
tomaarsen:fix/qwen2_5_omni_noisy_warning

Conversation

@tomaarsen
Copy link
Copy Markdown
Member

What does this PR do?

There's 2 changes, one is a definite fix and one is a preference. Some background: there are a lot of models that have finetuned qwen2_5_omni, e.g. https://huggingface.co/LCO-Embedding/LCO-Embedding-Omni-3B, and in the case of this model, finetuned with a whole new chat template/system prompt/no system prompt.

This is totally fine, except every single input processing results in a spam of

WARNING:root: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.'
WARNING:root: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.'
WARNING:root: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.'
WARNING:root: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.'
...

So I've made 2 changes:

  1. Use warning_once instead of warning every single time
  2. (My preference) being able to disable the warning altogether by setting check_audio_system_prompt or check_system_prompt in the processor config. That way I should be able to remove the warning altogether in these cases where it's a totally incorrect warning.

If change 2 goes too far, I can revert that commit and we can go for just option 1.

An alternative solution would be to just remove the warning: we don't often get involved with the chat template/system prompt choices of the architectures, right?

Code Agent Policy

  • I confirm that this is not a pure code agent PR.

This one was written manually, except the test, which was half generated

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

@zucchini-nlp

  • Tom Aarsen

@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Copy Markdown
Member

@zucchini-nlp zucchini-nlp left a comment

Choose a reason for hiding this comment

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

Yes, let's delete entirely!

Comment on lines -316 to -319
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.'"
)
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

Comment thread src/transformers/models/qwen2_5_omni/processing_qwen2_5_omni.py Outdated
@tomaarsen
Copy link
Copy Markdown
Member Author

tomaarsen commented Apr 15, 2026

That's music to my ears! Removed it fully now.

They don't make PRs better than this:
image

  • Tom Aarsen

@tomaarsen tomaarsen requested a review from zucchini-nlp April 15, 2026 12:01
Copy link
Copy Markdown
Member

@zucchini-nlp zucchini-nlp left a comment

Choose a reason for hiding this comment

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

Yaay, we can delete apply_chat_template entirely and merge!

Comment on lines -303 to -309
if isinstance(conversations[0], dict):
conversations = [conversations]
is_batched = True

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.

we can completely delete the whole fn 💃🏻

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

😲

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done in e0d7086

@github-actions
Copy link
Copy Markdown
Contributor

[For maintainers] Suggested jobs to run (before merge)

run-slow: qwen2_5_omni, qwen3_omni_moe

@tomaarsen tomaarsen added this pull request to the merge queue Apr 16, 2026
Merged via the queue into huggingface:main with commit c2579b9 Apr 16, 2026
17 checks passed
@tomaarsen tomaarsen deleted the fix/qwen2_5_omni_noisy_warning branch April 16, 2026 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants