mirror of
https://github.com/Nighthawk42/Qwen3-TTS-streaming.git
synced 2026-08-30 10:12:26 +00:00
fix loading logic
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user