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

Using llama3 through lit lama #487

Open
fireyanci opened this issue Apr 22, 2024 · 5 comments
Open

Using llama3 through lit lama #487

fireyanci opened this issue Apr 22, 2024 · 5 comments

Comments

@fireyanci
Copy link

If I want to use llama3 through lit lama, how can I modify it? I found that the model structure of llama3 has changed

@rasbt
Copy link
Contributor

rasbt commented Apr 22, 2024

While this repository is only focused on the first Llama model to keep the code as simple and readable as possible, we have the LitGPT repository (which is an extension of Lit-Llama) that also now supports Llama 3 as of Friday, thanks to @awaelchli

Hopefully this addressed your needs. And please let us know in case you bump into any issues.

@fireyanci
Copy link
Author

While this repository is only focused on the first Llama model to keep the code as simple and readable as possible, we have the LitGPT repository (which is an extension of Lit-Llama) that also now supports Llama 3 as of Friday, thanks to @awaelchli

Hopefully this addressed your needs. And please let us know in case you bump into any issues.

Thank you for your answer

@fireyanci
Copy link
Author

fireyanci commented Apr 22, 2024

While this repository is only focused on the first Llama model to keep the code as simple and readable as possible, we have the LitGPT repository (which is an extension of Lit-Llama) that also now supports Llama 3 as of Friday, thanks to @awaelchli

Hopefully this addressed your needs. And please let us know in case you bump into any issues.

Due to meta-ai lama-3-8b not using sentencePiece, but litgpt/tokenizer. py still uses sentencePiece. When I use the
litgpt chat -- checkpoint_dir E: \ checkpoint \ meta llama \ Meta-Llama-3-8B Instrument
RuntimeError: Internal: could not part ModelProto from E: \ checkpoint \ meta llama \ Meta Llama-3-8B Instrument \ tokenizer. model
Is there a new version of tokenizer. py that is compatible with llama-3 in Litgpt

@rasbt
Copy link
Contributor

rasbt commented Apr 22, 2024

I just saw your comment also in Lightning-AI/litgpt#1333. Let's continue the discussion there.

@awaelchli
Copy link
Contributor

@fireyanci A few notes here:

  • LitLlama is no longer being developed. The replacement is LitGPT. If you want to use Lama3 without major effort, please use LitGPT directly.
  • It is possible to make changes in LitLlama to support Llama3, but you'll have to update several files. If this is very important for you, I suggest start by copying over model.py, config.py and tokenizer.py and then work from there. But again, at this point you could use LitGPT directly.
  • In LitGPT, the tokenizer supports loading both sentenciepiece and huggingface tokenizers (including LLama3). Follow the download tutorial to get the LLama3 weights from HF.
  • Your messages indicate you are using a model called "Meta-Llama-3-8B Instrument". This does not exist. meta-llama/Meta-Llama-3-8B-Instruct is the correct name. Please try with this again.

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

3 participants