Lightning-AI / Lightning-AI/lit-llama
Can't convert Alpaca weights from HF
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 6.1k
- Forks
- 517
- PR merge metrics
- No merged PRs in 30d
Description
I tried converting the Alpaca weights from HF's repo, but it failed.
What I did was:
- python scripts/download.py --repo_id circulus/alpaca-7b --local_dir checkpoints/hf-alpaca/7B
- python scripts/convert_hf_checkpoint.py --model_size 7B --output_dir checkpoints/lit-alpaca/7B --checkpoint_dir checkpoints/hf-alpaca/7B
And I got this error:
Exception has occurred: RuntimeError
The size of tensor a (32000) must match the size of tensor b (32001) at non-singleton dimension 0
File "/home/admin/lit-llama/scripts/convert_hf_checkpoint.py", line 103, in convert_hf_checkpoint
sd[weight_map[name]].copy_(param)
File "/home/admin/lit-llama/scripts/convert_hf_checkpoint.py", line 136, in <module>
CLI(convert_hf_checkpoint)
RuntimeError: The size of tensor a (32000) must match the size of tensor b (32001) at non-singleton dimension 0
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure with the two commands in scripts/download.py and scripts/convert_hf_checkpoint.py. Start at line 103 of scripts/convert_hf_checkpoint.py and investigate the tensor-size mismatch; done means the Alpaca checkpoint converts without the reported RuntimeError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- huggingface, python
- Domain
- machine-learning, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100