Merged
Conversation
Signed-off-by: Noah Cylich <[email protected]>
Signed-off-by: Noah Cylich <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the HuggingFace model conversion code by clarifying config variable names and implementing efficient embedding weight tying. The changes rename ambiguous config variables, add fallback logic for retrieving tie_word_embeddings to support Transformers 5.0+, and use hard links instead of duplicating storage for tied embeddings.
Changes:
- Renamed
configtoroot_configandcfgtoconfigfor clarity in distinguishing between root-level and text-specific configurations - Added fallback logic to check both
configandroot_configfor tie_word_embeddings field - Replaced duplicate weight storage with hard links when embeddings are tied
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Noah Cylich <[email protected]>
cattermelon1234
pushed a commit
to cattermelon1234/cactus
that referenced
this pull request
Feb 28, 2026
* fixed tie embedding bug and improved embedding weight saving Signed-off-by: Noah Cylich <[email protected]> * improved variable naming Signed-off-by: Noah Cylich <[email protected]> * added log Signed-off-by: Noah Cylich <[email protected]> --------- Signed-off-by: Noah Cylich <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Renamed ambiguous configs in hf conversion and added checks for both root_config and config to retrieve tie embeddings in accordance with the new Transformers 5.0+ api.
Uses hard links to tie LM head to the embedding weights, eliminating all redundant/wasteful storage use