Skip to content

Conversation

@martin-gorner
Copy link
Contributor

Starting from Llama 3.2, the models use tied embeddings which means that the checkpoints no longer have a separate set of weights for reverse embeddings. This change allows the Transformer "tie_word_embeddings" setting to be read from config.json and instantiates the Llama3 ReversibleEmbedding class with the correct tie_weights setting.

Without this, loading Llama 3.2 errors out with the following error message:
"SafetensorError: File does not contain tensor lm_head.weight"

@google-cla
Copy link

google-cla bot commented Sep 30, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@martin-gorner
Copy link
Contributor Author

martin-gorner commented Sep 30, 2024

@osanseviero
Copy link

Hi 👋 The Llama 2 model you link to (https://huggingface.co/meta-llama/Llama-2-70b-chat) is not a transformers compatible repository but the original research checkpoints that were released. The transformers compatible repo is https://huggingface.co/meta-llama/Llama-2-70b-chat-hf.

Since Llama 3, Meta has released the models with the transformers-compatible weights as the primary release artifact, with the original research checkpoints in an original repository on the Hub.

Copy link
Collaborator

@divyashreepathihalli divyashreepathihalli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update Martin!

@divyashreepathihalli divyashreepathihalli merged commit eb13900 into keras-team:master Sep 30, 2024
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

Successfully merging this pull request may close these issues.

3 participants