Skip to content

How to merge lora adapter with pretrained weights? #399

Closed

Description

@MRQJsfhf
No description provided.

Activity

  1. danielhanchen commented on May 1, 2024

    @danielhanchen
    Member

    Oh our Colab notebooks on the bottom have this! See https://github.com/unslothai/unsloth/wiki#saving-models-to-16bit-for-vllm

    Ie:

    model.save_pretrained_merged("model", tokenizer, save_method = "merged_16bit",)
    model.push_to_hub_merged("hf/model", tokenizer, save_method = "merged_16bit", token = "")
  2. johnyquest7 commented on Jun 25, 2024

    @johnyquest7

    I have trained an adapter for Qwen2 and pushed it to huggingface hub after using auto train. Now I don’t have access to the virtual machine that created the adapter. But, I have access to the adapter. How do I merge this adapter with the original Qwen2 model?

  3. danielhanchen commented on Jul 1, 2024

    @danielhanchen
    Member

    So sorry on the delay @johnyquest7 - just relocated to SF so the slowness. You can try loading the adapter itself through FastLanguageModel.from_pretrained(adapter) then doing the saving to 16bit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions