Closed zarandioon closed 1 year ago
Hey @zarandioon , you can find the LoRa scripts in the lora branch for now. There is a PR open :)
@orangetin Thanks for the lora training scripts. I have 2 questions
Thanks & kind regards Alexander
Hey @alexanderfrey ,
import torch
from peft import PeftModel, PeftConfig
from transformers import AutoModelForCausalLM
peft_model_path ='PEFT_MODEL_OUTPUT_DIR'
config = PeftConfig.from_pretrained(peft_model_path) model = AutoModelForCausalLM.from_pretrained(config.base_model_name_or_path, return_dict=True, device_map='auto')
model = PeftModel.from_pretrained(model, peft_model_path)
model = model.merge_and_unload()
model.save_pretrained('MERGED_MODEL')
2. You should set `<human>` as the stop word for the RedPajama models (use the OIG dataset as an example for formatting your data). You could fine-tune the model with `<|endoftext|>` at the end of every training example, but that's up to you :)
Let me know if you have any other questions.
Closing issue as the LoRA example scripts have been merged into main: https://github.com/togethercomputer/OpenChatKit/tree/3eba68969f137c34cea92d55c0a040f1b16de3db/training/lora/example
Describe the bug Your blog refers to a LoRA script in the following location, but this does not exist. Can you please look into this?
/training/lora/redpajama-incite-chat-3b.py