Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some layers are not loaded(‘encoder.embed_token.weight’ and 'shared.weight') when loading converted safetensors into transfomrers.MT5EncoderModel. #520

Open
2 tasks done
WongGawa opened this issue Aug 23, 2024 · 0 comments

Comments

@WongGawa
Copy link

System Info

I converted pytorch_model.bin to model.safetensors locally for mt5-xxl model.
And I compared transfromers.MT5EncoderModel's last_hidden_states difference by mt5-xxl's pytorch_model.bin and safetensors.
And because encoder.embed_tokens.weight and shared.weight are not loaded into MT5EncoderModel when loading converted safetensors, which causes those layers to be newly initialized.

Information

  • The official example scripts
  • My own modified scripts

Reproduction

  1. convert pytorch_model.bin to model.safetensors by convert.py
  2. loading into transformers.MT5EncoderModel of pytorch_model.bin and converted model.safetensors
  3. compute difference between las_hidden_state of pytorch_model.bin and model.safetensors

Expected behavior

the same output or at lease within a certain margin of error

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

No branches or pull requests

1 participant