🚀 Code Llama
Code Llama is a collection of pretrained and fine - tuned generative text models. These models have parameter scales ranging from 7 billion to 34 billion. This repository contains the 13 - parameter instruct - tuned version in the Hugging Face Transformers format. It is designed for general code synthesis and understanding. You can find links to other models in the index at the bottom.
🚀 Quick Start
To use this model, you need to install the transformers
library. You can do this by running the following command:
pip install transformers.git accelerate
✨ Features
- Code Completion: The model can assist in completing code snippets.
- Infilling: It can fill in missing parts of the code.
- Instructions / Chat: It can follow instructions and engage in chat - like interactions.
- Not Python Specialist: Although it has some Python - related capabilities, it is not specialized for Python.
📦 Installation
To install the necessary libraries for using this model, run the following command:
pip install transformers.git accelerate
💻 Usage Examples
Basic Usage
To use the model, you first need to install the required libraries as shown above. Then you can start using it for various code - related tasks.
📚 Documentation
Model Details
- Model Developers: Meta developed and publicly released the Code Llama family of large language models (LLMs).
- Variations:
- Code Llama: Base models for general code synthesis and understanding.
- Code Llama - Python: Specifically designed for the Python programming language.
- Code Llama - Instruct: For instruction following and safer deployment.
All variants are available in sizes of 7B, 13B, 34B and 70B parameters. This repository contains the Instruct version of the 13B parameters model.
- Input: The models only accept text as input.
- Output: The models only generate text.
- Model Architecture: Code Llama is an auto - regressive language model that uses an optimized transformer architecture.
- Model Dates: Code Llama and its variants were trained between January 2023 and July 2023.
- Status: This is a static model trained on an offline dataset. Future versions of Code Llama - Instruct will be released as model safety is improved with community feedback.
Intended Use
- Intended Use Cases: Code Llama and its variants are for commercial and research use in English and relevant programming languages. The base model can be used for various code synthesis and understanding tasks. Code Llama - Python is for Python programming, and Code Llama - Instruct is safer for code assistant and generation applications.
- Out - of - Scope Uses: Using the model in a way that violates applicable laws or regulations, using it in languages other than English, or using it in any way prohibited by the Acceptable Use Policy and Licensing Agreement.
Hardware and Software
- Training Factors: Custom training libraries were used. The training and fine - tuning of the released models were performed on Meta’s Research Super Cluster.
- Carbon Footprint: Training all 9 Code Llama models required 400K GPU hours of computation on A100 - 80GB hardware. The estimated total emissions were 65.3 tCO2eq, and 100% of them were offset by Meta’s sustainability program.
Training Data
All experiments and the released models were trained and fine - tuned using the same data as Llama 2 with different weights. For details, refer to Section 2 and Table 1 in the research paper.
Evaluation Results
See evaluations for the main models and detailed ablations in Section 3 and safety evaluations in Section 4 of the research paper.
Ethical Considerations and Limitations
Code Llama and its variants are new technologies with risks. Testing has been in English and cannot cover all scenarios. The model's outputs cannot be predicted in advance, and it may produce inaccurate or objectionable responses. Developers should perform safety testing and tuning for their specific applications before deploying Code Llama. Refer to the Responsible Use Guide at https://ai.meta.com/llama/responsible-use-guide.
🔧 Technical Details
- Model Architecture: Code Llama is an auto - regressive language model that uses an optimized transformer architecture.
- Training Period: Code Llama and its variants were trained between January 2023 and July 2023.
📄 License
A custom commercial license is available at: https://ai.meta.com/resources/models-and-libraries/llama-downloads/
Model Variants Table
⚠️ Important Note
This is a non - official Code Llama repo. You can find the official Meta repository in the Meta Llama organization.