Llama2
Meta has introduced the Llama 2 family of large language models (LLMs), spanning from 7 billion to 70 billion parameters.
These models, particularly the Llama-2-Chat variants, are fine-tuned for dialogue applications and demonstrate superior performance compared to many open-source chat models, aligning closely with industry leaders like ChatGPT and PaLM in benchmarks of helpfulness and safety.
Model Variations
Llama 2 offers several sizes (7B, 13B, 70B) and includes both pretrained and fine-tuned models, with Llama-2-Chat being the standout for dialogue tasks.
Architecture and Training
Llama 2 employs an auto-regressive transformer architecture. The models are trained using a mix of publicly available data, with the 70B variant incorporating Grouped-Query Attention for enhanced inference scalability. Training occurred between January and July 2023.
Instructions for Accessing and Using Llama v2 Models
Finding the Models
Access HuggingFace Hub:
Visit the HuggingFace hub.
Use the search bar to look for "Llama v2" models.
Identify the Correct Models:
Look for models that have 'hf' in their name. For example, a model might be named
llama-v2-hf
.Models with 'hf' in their name are already converted to HuggingFace checkpoints. This means they are ready to use and require no further conversion.
Download or Use Models:
You can download these models directly for offline use, or you can reference them in your code by using their HuggingFace hub path.
Download the model into your LLama2-recipe directory
First, we must connect to Huggingface.
Create a repository to store a Huggingface token
git config --global credential.helper store
Then connect to Huggingface
huggingface-cli login
When asked to enter the authentication code, use:
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
When asked whether you want to add this as a git token credential, say yes. This should be the output:
Token is valid (permission: read).
Your token has been saved in your configured git credential helpers (store).
Your token has been saved to /home/paperspace/.cache/huggingface/token
Login successful
The install git large file storage so we can download the model (which is large)
git lfs install
If successful, the following output will be displayed in your terminal
Updated git hooks.
Git LFS initialized.
Enter the git clone command:
git clone https://huggingface.co/meta-llama/Llama-2-7b-chat-hf
The outcome should be new folder called LLama2-7b-chat-hf with all the appropriate files in it
Cloning Process:
Object Enumeration: The Git remote server started by enumerating objects.
It found 88 objects in total.
Object Download: All 88 objects were successfully downloaded.
The delta 0 indicates that these objects did not have delta compression
(differences between similar objects), which is common for initial clones.
Unpacking Objects: Git then unpacked these objects, which totalled 499.00 KiB in size.
The download speed was approximately 4.50 MiB/s.
Filtering Content with Git LFS: The repository uses Git LFS to handle large files. During the cloning process, Git LFS filtered and downloaded large files (totaling 9.10 GiB) at a rate of about 16.73 MiB/s.
Issues with Git LFS Files on Windows:
After cloning, there's a note about encountering issues with two files:
model-00001-of-00002.safetensors and pytorch_model-00001-of-00002.bin.
These files, likely large due to being managed by Git LFS, may not have been copied
correctly. This kind of issue can occur due to various reasons like LFS quota limits, network issues, or file system limitations, especially on Windows.
Reference to Git LFS Help:
The message See: 'git lfs help smudge' for more details suggests using the
Git LFS smudge command for help. The smudge command in Git LFS is involved in converting
pointer files in Git LFS to the actual large files.
Overall Time Taken:
The entire cloning process took 9m17s (9 minutes and 17 seconds).
Congratulations, you have now downloaded the models.
Last updated
Was this helpful?