huggingface / huggingface/alignment-handbook

"RuntimeError: The size of tensor a (0) must match the size of tensor b (4096) at non-singleton dimension 1" (DPO + LoRA)

Open
#57 7 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
5.7k
Forks
490
Avg merge
2m
Merged PRs (30d)
1

Description

So I'm attempting to run the DPO LoRA script and I'm getting this error:
```
RuntimeError: The size of tensor a (0) must match the size of tensor b (4096) at non-singleton dimension 1
```

... when the `model.merge_and_load()` runs here:
```
base_model = AutoModelForCausalLM.from_pretrained(peft_config.base_model_name_or_path, **model_kwargs)
model = PeftModel.from_pretrained(base_model, model_args.model_name_or_path, revision=model_args.model_revision)
model.eval()
model = model.merge_and_unload()
```

Any ideas?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.