You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
transformers 5.0.0rc中tie_weights函数的逻辑和v4.x的逻辑不一样。
在v4.x中,当tie_word_embeddings=True时,比如Qwen3-0.6B的config.json中tie_word_embeddings默认为True。无论embed_tokens.wheight和lm_head.weight是否都存在checkpoint中,这两个权重是绑定的
但是在v5.0.0rc中,如果embed_tokens.weight和lm_head.weight都在checkpoint中的话,那就不会绑定权重,而是两个独立的权重副本。
https://github.com/huggingface/transformers/blob/v5.0.0rc1/src/transformers/modeling_utils.py#L2362-L2369
那v5.0.0rc和v4.x在训练时,梯度更新行为就不一致。这会不会导致一些问题?比如保存的时候embed_tokens.weight和lm_head.weight都会保存在checkpoint中,但是我后续加载模型时还是想绑定这两个权重。
Beta Was this translation helpful? Give feedback.
All reactions