Skip to content
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

Guideline for generating correct lit_model.pth #9

Closed
mkeya013 opened this issue Sep 4, 2024 · 2 comments
Closed

Guideline for generating correct lit_model.pth #9

mkeya013 opened this issue Sep 4, 2024 · 2 comments

Comments

@mkeya013
Copy link

mkeya013 commented Sep 4, 2024

Dear Author, is it possible to provide correct lit_model.pth file? Or a guideline to generate correct lit_model.pth file would be a great help.

Thank you.

@LinghaoChan
Copy link
Collaborator

@mkeya013 Thanks for your question.

  1. git clone the `lit-gpt' and go into the corresponding dictionary.
git clone https://github.com/Lightning-AI/litgpt/tree/d78730a0694bff6c9f1ce285a6e8b471c1321cf5
cd ./litgpt/litgpt/scripts

To see all the available checkpoints for Vicuna, run:

python scripts/download.py | grep vicuna

which will print

lmsys/vicuna-7b-v1.3
lmsys/vicuna-13b-v1.3
lmsys/vicuna-33b-v1.3
lmsys/vicuna-7b-v1.5
lmsys/vicuna-7b-v1.5-16k
lmsys/vicuna-13b-v1.5
lmsys/vicuna-13b-v1.5-16k
  1. Download the model.

In order to use a specific Vicuna checkpoint, for instance vicuna-7b-v1.5, download the weights and convert the checkpoint to the lit-gpt format:

pip install huggingface_hub

python scripts/download.py --repo_id lmsys/vicuna-7b-v1.5

python scripts/convert_hf_checkpoint.py --checkpoint_dir checkpoints/lmsys/vicuna-7b-v1.5

By default, the convert_hf_checkpoint step will use the data type of the HF checkpoint's parameters. In cases where RAM
or disk size is constrained, it might be useful to pass --dtype bfloat16 to convert all parameters into this smaller precision before continuing.

You're done! To execute the model just run:

pip install sentencepiece

python chat/base.py --checkpoint_dir checkpoints/lmsys/vicuna-7b-v1.5

This is the vicuna version I used. You can also follow the latest official guideline and revise it to vicuna-7b-1.5.

@mkeya013
Copy link
Author

mkeya013 commented Sep 8, 2024

It worked. Thank you.

@mkeya013 mkeya013 closed this as completed Sep 8, 2024
LinghaoChan added a commit that referenced this issue Sep 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants