Skip to content

fix transformers 5.x API breaks#125

Open
niradler wants to merge 1 commit intoQwenLM:mainfrom
niradler:fix/transformers-5x-compat
Open

fix transformers 5.x API breaks#125
niradler wants to merge 1 commit intoQwenLM:mainfrom
niradler:fix/transformers-5x-compat

Conversation

@niradler
Copy link

Three API changes in transformers 5.x break qwen-asr with transformers >=5.0.

1. check_model_inputs removed

The decorator @check_model_inputs() was removed in transformers 5.x. The import raises ImportError at module load time, so qwen_asr cannot be imported at all with transformers 5.x.

Fix: guard the import with try/except and fall back to a transparent no-op decorator.

2. ROPE_INIT_FUNCTIONS default key removed

The default key was removed from ROPE_INIT_FUNCTIONS in transformers 5.x. Qwen3ASRThinkerTextRotaryEmbedding.init indexes into it with self.rope_type which defaults to default, raising KeyError at model load time.

Fix: fall back to a self-contained RoPE parameter function when the key is missing. Also adds _compute_default_rope_parameters as a method, since the @dynamic_rope_update decorator in transformers 5.x calls it.

3. pad_token_id missing on Qwen3ASRThinkerConfig

GenerationMixin in transformers 5.x requires pad_token_id to be explicitly present on the config object. The attribute is not declared as a class-level default on Qwen3ASRThinkerConfig, causing AttributeError during generation.

Fix: declare pad_token_id = None as a class-level default.

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.

1 participant