You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A quick test for the results after training showed that the model does not properly stop generating text. Do you append <|endoftext|> to every training example ?
This example will merge the lora weights to the base model:
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')
# Load the Lora model
model = PeftModel.from_pretrained(model, peft_model_path)
model = model.merge_and_unload()
model.save_pretrained('MERGED_MODEL')
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 :)
Activity
orangetin commentedon May 31, 2023
Hey @zarandioon , you can find the LoRa scripts in the lora branch for now. There is a PR open :)
alexanderfrey commentedon Jun 9, 2023
@orangetin Thanks for the lora training scripts. I have 2 questions
Thanks & kind regards
Alexander
orangetin commentedon Jun 9, 2023
Hey @alexanderfrey ,
<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