diff --git a/qwen_tts/core/models/modeling_qwen3_tts.py b/qwen_tts/core/models/modeling_qwen3_tts.py index 3ce406d..a3eb30a 100644 --- a/qwen_tts/core/models/modeling_qwen3_tts.py +++ b/qwen_tts/core/models/modeling_qwen3_tts.py @@ -1868,6 +1868,11 @@ class Qwen3TTSForConditionalGeneration(Qwen3TTSPreTrainedModel, GenerationMixin) weights_only=True, **kwargs, ): + # Hotfix to enable passing the correct attn implementation which is stored in the config but not in kwargs + requested_attn_implementation = kwargs.pop("attn_implementation", None) + if requested_attn_implementation is None and config and config._attn_implementation: + requested_attn_implementation = config._attn_implementation + model = super().from_pretrained( pretrained_model_name_or_path, *model_args, @@ -1880,6 +1885,7 @@ class Qwen3TTSForConditionalGeneration(Qwen3TTSPreTrainedModel, GenerationMixin) revision=revision, use_safetensors=use_safetensors, weights_only=weights_only, + attn_implementation=requested_attn_implementation, **kwargs, ) if not local_files_only and not os.path.isdir(pretrained_model_name_or_path):