[bugfix] fix qwen3 omni audio 30s#9182
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds .qoder/ to the .gitignore file and updates the omni_v3 template in qwen.py to disable audio truncation by default. A review comment points out that mutating global processor defaults is a side effect that could impact other instances and suggests using a more localized configuration approach instead.
| default = Qwen3OmniMoeProcessorKwargs._defaults | ||
| # Fix: WhisperFeatureExtractor defaults to truncation=True, which silently | ||
| # truncates audio longer than 30s. Qwen3 Omni supports variable-length audio, | ||
| # so we must disable truncation. See: huggingface/transformers#41473 | ||
| default.setdefault('audio_kwargs', {}) | ||
| default['audio_kwargs']['truncation'] = False |
There was a problem hiding this comment.
Modifying Qwen3OmniMoeProcessorKwargs._defaults is a global side effect that affects all instances of this processor class within the same process. This can lead to unexpected behavior if multiple models or different configurations are used concurrently in the same environment.
Consider if this can be handled by passing audio_kwargs={'truncation': False} during the processor call in the _encode method (similar to the implementation in Qwen3ASRTemplate) or by utilizing mm_processor_kwargs. This would keep the configuration local to the template instance and avoid mutating library-level defaults.
No description provided.