alpaca-lora icon indicating copy to clipboard operation
alpaca-lora copied to clipboard

Method of using the model generated after training

Open YSLLYW opened this issue 1 year ago • 1 comments

I would like to know how to use the trained model. It generates a checkpoint 30 folder, adapter_ Config.json and adapter_ model.bin。 How should I use Lora's finely tuned model? Can anyone help me?

bda955b54ed2f4d46efd98215067f44

YSLLYW avatar May 02 '23 11:05 YSLLYW

I found the following information online, but I don't understand the rest. Can anyone help me?

tokenizer = AutoTokenizer.from_pretrained("base-model", trust_remote_code=True) model = AutoModel.from_pretrained("bsae-model", trust_remote_code=True).half().cuda()

peft_config = LoraConfig( task_type=TaskType.CAUSAL_LM, inference_mode=False, r=8, lora_alpha=32, lora_dropout=0.1, target_modules=['query_key_value',], ) model = get_peft_model(model, peft_config)

YSLLYW avatar May 02 '23 11:05 YSLLYW

So I did not complete all training iterations, hence, the adapter-model.bin does not exist in my saved weights. How do I load my saved weights then? I have all the rest of my files in my checkpoint but adapter_config.json and adapter_mode.bin

thisisatharva avatar May 13 '23 19:05 thisisatharva