-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error with shape #27
Comments
Hi @manlenzzz , this script works for me. Could you please provide more details about the error? It looks like it's due to model = AutoModelForCausalLM.from_pretrained("LoftQ/Llama-2-7b-hf-4bit-64rank")
tokenizer = AutoTokenizer.from_pretrained("LoftQ/Llama-2-7b-hf-4bit-64rank")
smart_tokenizer_and_embedding_resize(model, tokenizer)
model = PeftModel.from_pretrained(model, "path/to/your/adapter") |
yes!you are right. After I modified the code it worked fine:
|
RuntimeError: Error(s) in loading state_dict for PeftModelForCausalLM:
size mismatch for base_model.model.model.embed_tokens.weight: copying a param with shape torch.Size([32001, 4096]) from checkpoint, the shape in current model is torch.Size([32000, 4096]).
size mismatch for base_model.model.lm_head.weight: copying a param with shape torch.Size([32001, 4096]) from checkpoint, the shape in current model is torch.Size([32000, 4096]).
I used the checkpoints from the training config:
python train_gsm8k.py
--model_name_or_path LoftQ/Llama-2-7b-hf-4bit-64rank
--learning_rate 3e-4
--seed 11
--expt_name gsm8k_llama2_7b_4bit_64rank_loftq
--output_dir exp_results/
--num_train_epochs 6
--per_device_train_batch_size 2
--gradient_accumulation_steps 8
--evaluation_strategy "no"
--save_strategy "epoch"
--weight_decay 0.1
--warmup_ratio 0.03
--lr_scheduler_type "cosine"
--logging_steps 10
--do_train
--report_to tensorboard
The text was updated successfully, but these errors were encountered: