Update modeling_qwen3_pseudo_moe.py

#2
by ctranslate2-4you - opened

Fix loading under Transformers 5 (_tied_weights_keys)
Loading fails on Transformers 5.x in post_init() with AttributeError: 'list' object has no attribute 'keys'. The cause is that _tied_weights_keys = [] uses the old list format while config.json sets tie_word_embeddings: true. This sets it to None, the PreTrainedModel default; nothing is tied, since the model has no LM head. It also replaces the deprecated config.use_return_dict with an equivalent expression. Tested with Transformers 4.51.3, 4.57.1 and 5.18.0: all 475 weights load and the embeddings are identical to the original code's.

Ready to merge
This branch is ready to get merged automatically.

Sign up or log in to comment