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

extract_lora : support tied embeddings #483

Closed
wants to merge 2 commits into from

Conversation

ngxson
Copy link

@ngxson ngxson commented Jan 8, 2025

Fix #447

Some small models like Llama 3.2 1B, 3B or Qwen 1.5B have tied embeddings, meaning token embeddings tensor and output tensor (lm_head) are the same.

Demo:

 mergekit-extract-lora \
  ngxson/MiniThinky-v2-1B-Llama-3.2 \
  meta-llama/Llama-3.2-1B-Instruct \
  lora_out --rank=16

@jrruethe jrruethe mentioned this pull request Jan 21, 2025
8 tasks
@cg123
Copy link
Collaborator

cg123 commented Jan 25, 2025

Thanks for the PR! I ended up implementing a more general solution that should also handle tied_names properly in #496 - hopefully this hits everything you need. If you have any more trouble with it let me know!

@cg123 cg123 closed this Jan 25, 2025
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.

mergekit-extract-lora does not extract - the destination is empty
2 participants