Skip to content

[bugfix] fix qwen3 omni audio 30s#9182

Merged
Jintao-Huang merged 1 commit into
modelscope:mainfrom
Jintao-Huang:fix_qwen3_omni_audio
Apr 22, 2026
Merged

[bugfix] fix qwen3 omni audio 30s#9182
Jintao-Huang merged 1 commit into
modelscope:mainfrom
Jintao-Huang:fix_qwen3_omni_audio

Conversation

@Jintao-Huang
Copy link
Copy Markdown
Collaborator

No description provided.

@Jintao-Huang Jintao-Huang linked an issue Apr 22, 2026 that may be closed by this pull request
1 task
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

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.

Comment on lines 636 to +641
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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

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.

@Jintao-Huang Jintao-Huang merged commit 2e84396 into modelscope:main Apr 22, 2026
3 checks passed
Jintao-Huang added a commit that referenced this pull request Apr 23, 2026
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.

Ms-swift训练Qwen3-Omni会将训练数据中的音频截断至30s

2 participants