-
Notifications
You must be signed in to change notification settings - Fork 451
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
Add custom resize_token_embeddings
method to OLMoForCausalLM
(#491)
#501
Merged
Commits on Mar 13, 2024
-
adds custom resize_token_embeddings method
This commit introduces the `resize_token_embeddings` function for the `OLMoForCausalLM` class. The function is based on the implementation from the Hugging Face Transformers library, with modifications to accommodate the specific requirements of the OLMo model. The `resize_token_embeddings` function allows resizing the input token embeddings matrix of the model when the number of tokens differs from the model's `embedding_size` configuration. It updates the `embedding_size` attribute in both the model configuration and the model itself, ensuring consistency after resizing. The function also handles tying the weights of the input and output embeddings if the model supports weight tying. Attribution: The implementation of this function is inspired by and adapted from the `resize_token_embeddings` function in the Hugging Face Transformers library (https://github.com/huggingface/transformers). The original code is licensed under the Apache License 2.0. Modifications: - Updated the function to use the `embedding_size` attribute instead of `vocab_size` to align with the OLMo model configuration. - Adjusted the docstring and comments to match the OLMo model's terminology and requirements.
Configuration menu - View commit details
-
Copy full SHA for 5b4e866 - Browse repository at this point
Copy the full SHA 5b4e866View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4e4ff1f - Browse repository at this point
Copy the full SHA 4e4ff1fView commit details -
Configuration menu - View commit details
-
Copy full SHA for cf774dc - Browse repository at this point
Copy the full SHA cf774dcView commit details -
Configuration menu - View commit details
-
Copy full SHA for 17149cf - Browse repository at this point
Copy the full SHA 17149cfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8f8e8c2 - Browse repository at this point
Copy the full SHA 8f8e8c2View commit details
Commits on Mar 15, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 36140c4 - Browse repository at this point
Copy the full SHA 36140c4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1dedce9 - Browse repository at this point
Copy the full SHA 1dedce9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2da225e - Browse repository at this point
Copy the full SHA 2da225eView commit details
Commits on Mar 16, 2024
-
Configuration menu - View commit details
-
Copy full SHA for ba72c66 - Browse repository at this point
Copy the full SHA ba72c66View commit details
Commits on Mar 20, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 04065f0 - Browse repository at this point
Copy the full SHA 04065f0View commit details -
clarifies difference between the updated method and the base class method
Configuration menu - View commit details
-
Copy full SHA for f395a55 - Browse repository at this point
Copy the full SHA f395a55View commit details
Commits on Mar 21, 2024
-
Configuration menu - View commit details
-
Copy full SHA for ee9e9ff - Browse repository at this point
Copy the full SHA ee9e9ffView commit details -
switching warning to log.warning and fixes comment indent
Configuration menu - View commit details
-
Copy full SHA for e1ec4b3 - Browse repository at this point
Copy the full SHA e1ec4b3View commit details
Commits on Mar 22, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 1595326 - Browse repository at this point
Copy the full SHA 1595326View commit details -
Configuration menu - View commit details
-
Copy full SHA for e186f5b - Browse repository at this point
Copy the full SHA e186f5bView commit details
Commits on Mar 28, 2024
-
Configuration menu - View commit details
-
Copy full SHA for aa5687d - Browse repository at this point
Copy the full SHA aa5687dView commit details
Commits on Apr 2, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 3cdfcde - Browse repository at this point
Copy the full SHA 3cdfcdeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 81d30d4 - Browse repository at this point
Copy the full SHA 81d30d4View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.