Instructions to use codellama/CodeLlama-70b-hf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use codellama/CodeLlama-70b-hf with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="codellama/CodeLlama-70b-hf")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("codellama/CodeLlama-70b-hf") model = AutoModelForCausalLM.from_pretrained("codellama/CodeLlama-70b-hf") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use codellama/CodeLlama-70b-hf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "codellama/CodeLlama-70b-hf" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "codellama/CodeLlama-70b-hf", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/codellama/CodeLlama-70b-hf
- SGLang
How to use codellama/CodeLlama-70b-hf with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "codellama/CodeLlama-70b-hf" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "codellama/CodeLlama-70b-hf", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "codellama/CodeLlama-70b-hf" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "codellama/CodeLlama-70b-hf", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use codellama/CodeLlama-70b-hf with Docker Model Runner:
docker model run hf.co/codellama/CodeLlama-70b-hf
Adding Evaluation Results
Browse filesThis is an automated PR created with https://huggingface.co/spaces/Weyaxi/open-llm-leaderboard-results-pr
The purpose of this PR is to add evaluation results from the Open LLM Leaderboard to your model card.
If you encounter any issues, please report them to https://huggingface.co/spaces/Weyaxi/open-llm-leaderboard-results-pr/discussions
README.md
CHANGED
|
@@ -1,10 +1,113 @@
|
|
| 1 |
---
|
| 2 |
language:
|
| 3 |
- code
|
| 4 |
-
|
| 5 |
tags:
|
| 6 |
- llama-2
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
# **Code Llama**
|
| 10 |
Code Llama is a collection of pretrained and fine-tuned generative text models ranging in scale from 7 billion to 70 billion parameters. This is the repository for the base 70B version in the Hugging Face Transformers format. This model is designed for general code synthesis and understanding. Links to other models can be found in the index at the bottom.
|
|
@@ -80,3 +183,17 @@ See evaluations for the main models and detailed ablations in Section 3 and safe
|
|
| 80 |
Code Llama and its variants are a new technology that carries risks with use. Testing conducted to date has been in English, and has not covered, nor could it cover all scenarios. For these reasons, as with all LLMs, Code Llama’s potential outputs cannot be predicted in advance, and the model may in some instances produce inaccurate or objectionable responses to user prompts. Therefore, before deploying any applications of Code Llama, developers should perform safety testing and tuning tailored to their specific applications of the model.
|
| 81 |
|
| 82 |
Please see the Responsible Use Guide available available at [https://ai.meta.com/llama/responsible-use-guide](https://ai.meta.com/llama/responsible-use-guide).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
language:
|
| 3 |
- code
|
| 4 |
+
license: llama2
|
| 5 |
tags:
|
| 6 |
- llama-2
|
| 7 |
+
pipeline_tag: text-generation
|
| 8 |
+
model-index:
|
| 9 |
+
- name: CodeLlama-70b-hf
|
| 10 |
+
results:
|
| 11 |
+
- task:
|
| 12 |
+
type: text-generation
|
| 13 |
+
name: Text Generation
|
| 14 |
+
dataset:
|
| 15 |
+
name: AI2 Reasoning Challenge (25-Shot)
|
| 16 |
+
type: ai2_arc
|
| 17 |
+
config: ARC-Challenge
|
| 18 |
+
split: test
|
| 19 |
+
args:
|
| 20 |
+
num_few_shot: 25
|
| 21 |
+
metrics:
|
| 22 |
+
- type: acc_norm
|
| 23 |
+
value: 56.74
|
| 24 |
+
name: normalized accuracy
|
| 25 |
+
source:
|
| 26 |
+
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=codellama/CodeLlama-70b-hf
|
| 27 |
+
name: Open LLM Leaderboard
|
| 28 |
+
- task:
|
| 29 |
+
type: text-generation
|
| 30 |
+
name: Text Generation
|
| 31 |
+
dataset:
|
| 32 |
+
name: HellaSwag (10-Shot)
|
| 33 |
+
type: hellaswag
|
| 34 |
+
split: validation
|
| 35 |
+
args:
|
| 36 |
+
num_few_shot: 10
|
| 37 |
+
metrics:
|
| 38 |
+
- type: acc_norm
|
| 39 |
+
value: 78.21
|
| 40 |
+
name: normalized accuracy
|
| 41 |
+
source:
|
| 42 |
+
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=codellama/CodeLlama-70b-hf
|
| 43 |
+
name: Open LLM Leaderboard
|
| 44 |
+
- task:
|
| 45 |
+
type: text-generation
|
| 46 |
+
name: Text Generation
|
| 47 |
+
dataset:
|
| 48 |
+
name: MMLU (5-Shot)
|
| 49 |
+
type: cais/mmlu
|
| 50 |
+
config: all
|
| 51 |
+
split: test
|
| 52 |
+
args:
|
| 53 |
+
num_few_shot: 5
|
| 54 |
+
metrics:
|
| 55 |
+
- type: acc
|
| 56 |
+
value: 59.67
|
| 57 |
+
name: accuracy
|
| 58 |
+
source:
|
| 59 |
+
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=codellama/CodeLlama-70b-hf
|
| 60 |
+
name: Open LLM Leaderboard
|
| 61 |
+
- task:
|
| 62 |
+
type: text-generation
|
| 63 |
+
name: Text Generation
|
| 64 |
+
dataset:
|
| 65 |
+
name: TruthfulQA (0-shot)
|
| 66 |
+
type: truthful_qa
|
| 67 |
+
config: multiple_choice
|
| 68 |
+
split: validation
|
| 69 |
+
args:
|
| 70 |
+
num_few_shot: 0
|
| 71 |
+
metrics:
|
| 72 |
+
- type: mc2
|
| 73 |
+
value: 39.79
|
| 74 |
+
source:
|
| 75 |
+
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=codellama/CodeLlama-70b-hf
|
| 76 |
+
name: Open LLM Leaderboard
|
| 77 |
+
- task:
|
| 78 |
+
type: text-generation
|
| 79 |
+
name: Text Generation
|
| 80 |
+
dataset:
|
| 81 |
+
name: Winogrande (5-shot)
|
| 82 |
+
type: winogrande
|
| 83 |
+
config: winogrande_xl
|
| 84 |
+
split: validation
|
| 85 |
+
args:
|
| 86 |
+
num_few_shot: 5
|
| 87 |
+
metrics:
|
| 88 |
+
- type: acc
|
| 89 |
+
value: 75.22
|
| 90 |
+
name: accuracy
|
| 91 |
+
source:
|
| 92 |
+
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=codellama/CodeLlama-70b-hf
|
| 93 |
+
name: Open LLM Leaderboard
|
| 94 |
+
- task:
|
| 95 |
+
type: text-generation
|
| 96 |
+
name: Text Generation
|
| 97 |
+
dataset:
|
| 98 |
+
name: GSM8k (5-shot)
|
| 99 |
+
type: gsm8k
|
| 100 |
+
config: main
|
| 101 |
+
split: test
|
| 102 |
+
args:
|
| 103 |
+
num_few_shot: 5
|
| 104 |
+
metrics:
|
| 105 |
+
- type: acc
|
| 106 |
+
value: 43.97
|
| 107 |
+
name: accuracy
|
| 108 |
+
source:
|
| 109 |
+
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=codellama/CodeLlama-70b-hf
|
| 110 |
+
name: Open LLM Leaderboard
|
| 111 |
---
|
| 112 |
# **Code Llama**
|
| 113 |
Code Llama is a collection of pretrained and fine-tuned generative text models ranging in scale from 7 billion to 70 billion parameters. This is the repository for the base 70B version in the Hugging Face Transformers format. This model is designed for general code synthesis and understanding. Links to other models can be found in the index at the bottom.
|
|
|
|
| 183 |
Code Llama and its variants are a new technology that carries risks with use. Testing conducted to date has been in English, and has not covered, nor could it cover all scenarios. For these reasons, as with all LLMs, Code Llama’s potential outputs cannot be predicted in advance, and the model may in some instances produce inaccurate or objectionable responses to user prompts. Therefore, before deploying any applications of Code Llama, developers should perform safety testing and tuning tailored to their specific applications of the model.
|
| 184 |
|
| 185 |
Please see the Responsible Use Guide available available at [https://ai.meta.com/llama/responsible-use-guide](https://ai.meta.com/llama/responsible-use-guide).
|
| 186 |
+
|
| 187 |
+
# [Open LLM Leaderboard Evaluation Results](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard)
|
| 188 |
+
Detailed results can be found [here](https://huggingface.co/datasets/open-llm-leaderboard/details_codellama__CodeLlama-70b-hf)
|
| 189 |
+
|
| 190 |
+
| Metric |Value|
|
| 191 |
+
|---------------------------------|----:|
|
| 192 |
+
|Avg. |58.93|
|
| 193 |
+
|AI2 Reasoning Challenge (25-Shot)|56.74|
|
| 194 |
+
|HellaSwag (10-Shot) |78.21|
|
| 195 |
+
|MMLU (5-Shot) |59.67|
|
| 196 |
+
|TruthfulQA (0-shot) |39.79|
|
| 197 |
+
|Winogrande (5-shot) |75.22|
|
| 198 |
+
|GSM8k (5-shot) |43.97|
|
| 199 |
+
|