#I want to re-use LoRA weight for continuing training.

11 messages · Page 1 of 1 (latest)

clear night
#

I made a personality of llama3 and qwen 1.5 for understanding how to build a human like agent.

But I want to:

  1. Pre-train LoRA Layer for base knowledge.
  2. Using less learning rate for conversations and personality training.

But every time I reload model, the LoRA will refresh to without trained state.

Can I save Unsloth LoRA weight to Huggingface and continue training next time?

Or any way to reuse?

velvet barn
#

Merge them first.

clear night
#

@velvet barn Okay I just merge.

And if I upload to my huggingface and dowload my model again then call Unsloth to train LoRA again.

What is the new status of the model:

  1. Base model + old LoRA layer + New LoRA layer

  2. Base model + old LoRA re-use in new LoRA training
    ?

It's little difference.

velvet barn
#

When you merge them, it will be no LoRa layer anymore, it's just a model.

clear night
#

@velvet barn Thank you, so I can add layer by layer every time ?

As I know LoRA is some additional layers add on Base model.

Is while I merge a LoRA to Base model they will be a apart of model?

velvet barn
#

When you merge them, they become one.
Yes.

clear night
#

Thank !

lusty bane
#

how to merge fine tuned QLoRA adapter ( on 4-bit base model) to base model? I found documentation very confusing. any code help?

velvet barn
lusty bane
#

model.save_pretrained("lora_model") # Local saving
tokenizer.save_pretrained("lora_model")

Merge to 16bit

if True: model.save_pretrained_merged("model", tokenizer, save_method = "merged_16bit",) - is this code?

lusty bane
# velvet barn Any Colab notebook has the merge code.

Rizwan Delhi — Today at 13:32
model.save_pretrained("lora_model") # Local saving
tokenizer.save_pretrained("lora_model")
Merge to 16bit
if True: model.save_pretrained_merged("model", tokenizer, save_method = "merged_16bit",) - is this code?