alpaca-lora
alpaca-lora copied to clipboard
Method of using the model generated after training
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?
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)
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