-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add example scripts to show how to run the model #108
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
Conversation
): | ||
max_gen_len = self.model.params.max_seq_len - 1 | ||
|
||
prompt_tokens = self.tokenizer.encode(x, bos=True, eos=False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prompt_tokens = self.tokenizer.encode(x, bos=True, eos=False) | |
prompt_tokens = self.tokenizer.encode(prompt, bos=True, eos=False) |
@@ -34,7 +34,36 @@ Pre-requisites: Ensure you have `wget` installed. Then run the script: `./downlo | |||
|
|||
Remember that the links expire after 24 hours and a certain amount of downloads. You can always re-request a link if you start seeing errors such as `403: Forbidden`. | |||
|
|||
### Access to Hugging Face | |||
## Running the models |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this blurb here to the README. cc @karpathy
The example is on the right track. Great effort. Thanks. Still it assumes some prior experience of how these llama models are used. I'd like the example to be a bit more explicit for someone with no experience with llama models. A hello world that will just work by following the instructions. After I get it working, then I can start to break it down and see what is going on inside. I think it only needs a couple small tweaks. Some explanation, with working example, as to what to use for <CHECKPOINT_DIR> and <TOKENIZER_PATH> As it is now, it doesn't actually provide explicit example of how to run the downloaded files! How do we actually reference the files that were just downloaded? models/llama3_1/Meta-Llama-3.1-8B/consolidated.00.pth I'm also curious that the "tokenizer.model" file is also in the api folder, as well as with the model. And was thinking that since the example is based on the files in the api folder, it seems like we might not need to reference a tokenizer model explicitly? (I'm assuming that the <TOKENIZER_PATH> needs to refer to this tokenizer.model file.) Is this correct, and/or needed for a simple hello world example? |
Do not see this PR in main anymore . |
@whatdhack The content just changed location? It is in |
Folks really want the
llama-models
repository to be self-contained. That is, they want to be able to simply run the models without needing other dependencies likellama-toolchain
. See #82 for a discussion.This PR adapts the
example_*_completion.py
scripts from themeta-llama/llama3/
repository so it works for llama3.1 models with the updated types.Note that in order to run these scripts, you need to install additional dependencies not specified in
requirements.txt
: These are: