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
Then connect to Huggingface
When asked to enter the authentication code, use:
When asked whether you want to add this as a git token credential, say yes. This should be the output:
The install git large file storage so we can download the model (which is large)
If successful, the following output will be displayed in your terminal
Enter the git clone command:
The outcome should be new folder called LLama2-7b-chat-hf with all the appropriate files in it
Congratulations, you have now downloaded the models.
Last updated
Was this helpful?

