TheBloke commited on
Commit
2dd6712
1 Parent(s): 237867d

Initial GPTQ model commit

Browse files
Files changed (1) hide show
  1. README.md +347 -0
README.md ADDED
@@ -0,0 +1,347 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ inference: false
3
+ license: llama2
4
+ model_creator: Meta
5
+ model_link: https://ai.meta.com/resources/models-and-libraries/llama-downloads
6
+ model_name: CodeLlama 13B Instruct
7
+ model_type: llama
8
+ quantized_by: TheBloke
9
+ tags:
10
+ - llama-2
11
+ - codellama
12
+ ---
13
+
14
+ <!-- header start -->
15
+ <!-- 200823 -->
16
+ <div style="width: auto; margin-left: auto; margin-right: auto">
17
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
18
+ </div>
19
+ <div style="display: flex; justify-content: space-between; width: 100%;">
20
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
21
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
22
+ </div>
23
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
24
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://www.patreon.com/TheBlokeAI">Want to contribute? TheBloke's Patreon page</a></p>
25
+ </div>
26
+ </div>
27
+ <div style="text-align:center; margin-top: 0em; margin-bottom: 0em"><p style="margin-top: 0.25em; margin-bottom: 0em;">TheBloke's LLM work is generously supported by a grant from <a href="https://a16z.com">andreessen horowitz (a16z)</a></p></div>
28
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
29
+ <!-- header end -->
30
+
31
+ # CodeLlama 13B Instruct - GPTQ
32
+ - Model creator: [Meta](https://huggingface.co/meta-llama)
33
+ - Original model: [CodeLlama 13B Instruct](https://ai.meta.com/resources/models-and-libraries/llama-downloads)
34
+
35
+ ## Description
36
+
37
+ This repo contains GPTQ model files for [Meta's CodeLlama 13B Instruct](https://ai.meta.com/resources/models-and-libraries/llama-downloads).
38
+
39
+ Multiple GPTQ parameter permutations are provided; see Provided Files below for details of the options provided, their parameters, and the software used to create them.
40
+
41
+ ## Repositories available
42
+
43
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/CodeLlama-13B-Instruct-GPTQ)
44
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/CodeLlama-13B-Instruct-GGUF)
45
+ * [2, 3, 4, 5, 6 and 8-bit GGML models for CPU+GPU inference (deprecated)](https://huggingface.co/TheBloke/CodeLlama-13B-Instruct-GGML)
46
+ * [Meta's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/TheBloke/CodeLlama-13B-Instruct-fp16)
47
+
48
+ ## Prompt template: TBC
49
+
50
+ ```
51
+ Info on prompt template will be added shortly.
52
+ ```
53
+
54
+ ## Provided files and GPTQ parameters
55
+
56
+ Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
57
+
58
+ Each separate quant is in a different branch. See below for instructions on fetching from different branches.
59
+
60
+ All GPTQ files are made with AutoGPTQ.
61
+
62
+ <details>
63
+ <summary>Explanation of GPTQ parameters</summary>
64
+
65
+ - Bits: The bit size of the quantised model.
66
+ - GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
67
+ - Act Order: True or False. Also known as `desc_act`. True results in better quantisation accuracy. Some GPTQ clients have issues with models that use Act Order plus Group Size.
68
+ - Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
69
+ - GPTQ dataset: The dataset used for quantisation. Using a dataset more appropriate to the model's training can improve quantisation accuracy. Note that the GPTQ dataset is not the same as the dataset used to train the model - please refer to the original model repo for details of the training dataset(s).
70
+ - Sequence Length: The length of the dataset sequences used for quantisation. Ideally this is the same as the model sequence length. For some very long sequence models (16+K), a lower sequence length may have to be used. Note that a lower sequence length does not limit the sequence length of the quantised model. It only impacts the quantisation accuracy on longer inference sequences.
71
+ - ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama models in 4-bit.
72
+
73
+ </details>
74
+
75
+ | Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
76
+ | ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
77
+ | [main](https://huggingface.co/TheBloke/CodeLlama-13B-Instruct-GPTQ/tree/main) | 4 | 128 | No | 0.1 | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 8192 | 7.26 GB | Yes | Most compatible option. Good inference speed in AutoGPTQ and GPTQ-for-LLaMa. Lower inference quality than other options. |
78
+ | [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/CodeLlama-13B-Instruct-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | 0.1 | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 8192 | 8.00 GB | Yes | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. Poor AutoGPTQ CUDA speed. |
79
+ | [gptq-4bit-64g-actorder_True](https://huggingface.co/TheBloke/CodeLlama-13B-Instruct-GPTQ/tree/gptq-4bit-64g-actorder_True) | 4 | 64 | Yes | 0.1 | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 8192 | 7.51 GB | Yes | 4-bit, with Act Order and group size 64g. Uses less VRAM than 32g, but with slightly lower accuracy. Poor AutoGPTQ CUDA speed. |
80
+ | [gptq-4bit-128g-actorder_True](https://huggingface.co/TheBloke/CodeLlama-13B-Instruct-GPTQ/tree/gptq-4bit-128g-actorder_True) | 4 | 128 | Yes | 0.1 | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 8192 | 7.26 GB | Yes | 4-bit, with Act Order and group size 128g. Uses even less VRAM than 64g, but with slightly lower accuracy. Poor AutoGPTQ CUDA speed. |
81
+ | [gptq-8bit--1g-actorder_True](https://huggingface.co/TheBloke/CodeLlama-13B-Instruct-GPTQ/tree/gptq-8bit--1g-actorder_True) | 8 | None | Yes | 0.1 | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 8192 | 13.36 GB | No | 8-bit, with Act Order. No group size, to lower VRAM requirements and to improve AutoGPTQ speed. |
82
+ | [gptq-8bit-128g-actorder_True](https://huggingface.co/TheBloke/CodeLlama-13B-Instruct-GPTQ/tree/gptq-8bit-128g-actorder_True) | 8 | 128 | Yes | 0.1 | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 8192 | 13.65 GB | No | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. Poor AutoGPTQ CUDA speed. |
83
+
84
+ ## How to download from branches
85
+
86
+ - In text-generation-webui, you can add `:branch` to the end of the download name, eg `TheBloke/CodeLlama-13B-Instruct-GPTQ:gptq-4bit-32g-actorder_True`
87
+ - With Git, you can clone a branch with:
88
+ ```
89
+ git clone --single-branch --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/CodeLlama-13B-Instruct-GPTQ
90
+ ```
91
+ - In Python Transformers code, the branch is the `revision` parameter; see below.
92
+
93
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
94
+
95
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
96
+
97
+ It is strongly recommended to use the text-generation-webui one-click-installers unless you know how to make a manual install.
98
+
99
+ 1. Click the **Model tab**.
100
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/CodeLlama-13B-Instruct-GPTQ`.
101
+ - To download from a specific branch, enter for example `TheBloke/CodeLlama-13B-Instruct-GPTQ:gptq-4bit-32g-actorder_True`
102
+ - see Provided Files above for the list of branches for each option.
103
+ 3. Click **Download**.
104
+ 4. The model will start downloading. Once it's finished it will say "Done"
105
+ 5. In the top left, click the refresh icon next to **Model**.
106
+ 6. In the **Model** dropdown, choose the model you just downloaded: `CodeLlama-13B-Instruct-GPTQ`
107
+ 7. The model will automatically load, and is now ready for use!
108
+ 8. If you want any custom settings, set them and then click **Save settings for this model** followed by **Reload the Model** in the top right.
109
+ * Note that you do not need to set GPTQ parameters any more. These are set automatically from the file `quantize_config.json`.
110
+ 9. Once you're ready, click the **Text Generation tab** and enter a prompt to get started!
111
+
112
+ ## How to use this GPTQ model from Python code
113
+
114
+ First make sure you have [AutoGPTQ](https://github.com/PanQiWei/AutoGPTQ) 0.3.1 or later installed:
115
+
116
+ ```
117
+ pip3 install auto-gptq
118
+ ```
119
+
120
+ If you have problems installing AutoGPTQ, please build from source instead:
121
+ ```
122
+ pip3 uninstall -y auto-gptq
123
+ git clone https://github.com/PanQiWei/AutoGPTQ
124
+ cd AutoGPTQ
125
+ pip3 install .
126
+ ```
127
+
128
+ Then try the following example code:
129
+
130
+ ```python
131
+ from transformers import AutoTokenizer, pipeline, logging
132
+ from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
133
+
134
+ model_name_or_path = "TheBloke/CodeLlama-13B-Instruct-GPTQ"
135
+
136
+ use_triton = False
137
+
138
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
139
+
140
+ model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
141
+ use_safetensors=True,
142
+ trust_remote_code=True,
143
+ device="cuda:0",
144
+ use_triton=use_triton,
145
+ quantize_config=None)
146
+
147
+ """
148
+ # To download from a specific branch, use the revision parameter, as in this example:
149
+ # Note that `revision` requires AutoGPTQ 0.3.1 or later!
150
+
151
+ model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
152
+ revision="gptq-4bit-32g-actorder_True",
153
+ use_safetensors=True,
154
+ trust_remote_code=True,
155
+ device="cuda:0",
156
+ quantize_config=None)
157
+ """
158
+
159
+ prompt = "Tell me about AI"
160
+ prompt_template=f'''Info on prompt template will be added shortly.
161
+ '''
162
+
163
+ print("\n\n*** Generate:")
164
+
165
+ input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
166
+ output = model.generate(inputs=input_ids, temperature=0.7, max_new_tokens=512)
167
+ print(tokenizer.decode(output[0]))
168
+
169
+ # Inference can also be done using transformers' pipeline
170
+
171
+ # Prevent printing spurious transformers error when using pipeline with AutoGPTQ
172
+ logging.set_verbosity(logging.CRITICAL)
173
+
174
+ print("*** Pipeline:")
175
+ pipe = pipeline(
176
+ "text-generation",
177
+ model=model,
178
+ tokenizer=tokenizer,
179
+ max_new_tokens=512,
180
+ temperature=0.7,
181
+ top_p=0.95,
182
+ repetition_penalty=1.15
183
+ )
184
+
185
+ print(pipe(prompt_template)[0]['generated_text'])
186
+ ```
187
+
188
+ ## Compatibility
189
+
190
+ The files provided will work with AutoGPTQ (CUDA and Triton modes), GPTQ-for-LLaMa (only CUDA has been tested), and Occ4m's GPTQ-for-LLaMa fork.
191
+
192
+ ExLlama works with Llama models in 4-bit. Please see the Provided Files table above for per-file compatibility.
193
+
194
+ <!-- footer start -->
195
+ <!-- 200823 -->
196
+ ## Discord
197
+
198
+ For further support, and discussions on these models and AI in general, join us at:
199
+
200
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
201
+
202
+ ## Thanks, and how to contribute.
203
+
204
+ Thanks to the [chirper.ai](https://chirper.ai) team!
205
+
206
+ I've had a lot of people ask if they can contribute. I enjoy providing models and helping people, and would love to be able to spend even more time doing it, as well as expanding into new projects like fine tuning/training.
207
+
208
+ If you're able and willing to contribute it will be most gratefully received and will help me to keep providing more models, and to start work on new AI projects.
209
+
210
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
211
+
212
+ * Patreon: https://patreon.com/TheBlokeAI
213
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
214
+
215
+ **Special thanks to**: Aemon Algiz.
216
+
217
+ **Patreon special mentions**: Sam, theTransient, Jonathan Leane, Steven Wood, webtim, Johann-Peter Hartmann, Geoffrey Montalvo, Gabriel Tamborski, Willem Michiel, John Villwock, Derek Yates, Mesiah Bishop, Eugene Pentland, Pieter, Chadd, Stephen Murray, Daniel P. Andersen, terasurfer, Brandon Frisco, Thomas Belote, Sid, Nathan LeClaire, Magnesian, Alps Aficionado, Stanislav Ovsiannikov, Alex, Joseph William Delisle, Nikolai Manek, Michael Davis, Junyu Yang, K, J, Spencer Kim, Stefan Sabev, Olusegun Samson, transmissions 11, Michael Levine, Cory Kujawski, Rainer Wilmers, zynix, Kalila, Luke @flexchar, Ajan Kanaga, Mandus, vamX, Ai Maven, Mano Prime, Matthew Berman, subjectnull, Vitor Caleffi, Clay Pascal, biorpg, alfie_i, 阿明, Jeffrey Morgan, ya boyyy, Raymond Fosdick, knownsqashed, Olakabola, Leonard Tan, ReadyPlayerEmma, Enrico Ros, Dave, Talal Aujan, Illia Dulskyi, Sean Connelly, senxiiz, Artur Olbinski, Elle, Raven Klaugh, Fen Risland, Deep Realms, Imad Khwaja, Fred von Graf, Will Dee, usrbinkat, SuperWojo, Alexandros Triantafyllidis, Swaroop Kallakuri, Dan Guido, John Detwiler, Pedro Madruga, Iucharbius, Viktor Bowallius, Asp the Wyvern, Edmond Seymore, Trenton Dambrowitz, Space Cruiser, Spiking Neurons AB, Pyrater, LangChain4j, Tony Hughes, Kacper Wikieł, Rishabh Srivastava, David Ziegler, Luke Pendergrass, Andrey, Gabriel Puliatti, Lone Striker, Sebastain Graf, Pierre Kircher, Randy H, NimbleBox.ai, Vadim, danny, Deo Leter
218
+
219
+
220
+ Thank you to all my generous patrons and donaters!
221
+
222
+ And thank you again to a16z for their generous grant.
223
+
224
+ <!-- footer end -->
225
+
226
+ # Original model card: Meta's CodeLlama 13B Instruct
227
+
228
+
229
+ <!-- header start -->
230
+ <!-- 200823 -->
231
+ <div style="width: auto; margin-left: auto; margin-right: auto">
232
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
233
+ </div>
234
+ <div style="display: flex; justify-content: space-between; width: 100%;">
235
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
236
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
237
+ </div>
238
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
239
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://www.patreon.com/TheBlokeAI">Want to contribute? TheBloke's Patreon page</a></p>
240
+ </div>
241
+ </div>
242
+ <div style="text-align:center; margin-top: 0em; margin-bottom: 0em"><p style="margin-top: 0.25em; margin-bottom: 0em;">TheBloke's LLM work is generously supported by a grant from <a href="https://a16z.com">andreessen horowitz (a16z)</a></p></div>
243
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
244
+ <!-- header end -->
245
+
246
+ # CodeLlama 13B-Instruct fp16
247
+ - Model creator: [Meta](https://ai.meta.com/llama/)
248
+
249
+ ## Description
250
+
251
+ This is Transformers/HF format fp16 weights for CodeLlama 13B-Instruct. It is the result of downloading CodeLlama 13B-Instruct from [Meta](https://ai.meta.com/blog/code-llama-large-language-model-coding/) and converting to HF using `convert_llama_weights_to_hf.py`.
252
+
253
+ Quantisations will be coming shortly.
254
+
255
+ Please note that due to a change in the RoPE Theta value, for correct results you must load these FP16 models with `trust_remote_code=True`
256
+
257
+ Credit to @emozilla for creating the necessary modelling code to achieve this!
258
+
259
+ ## Prompt template: TBC
260
+
261
+
262
+ <!-- footer start -->
263
+ <!-- 200823 -->
264
+ ## Discord
265
+
266
+ For further support, and discussions on these models and AI in general, join us at:
267
+
268
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
269
+
270
+ ## Thanks, and how to contribute.
271
+
272
+ Thanks to the [chirper.ai](https://chirper.ai) team!
273
+
274
+ I've had a lot of people ask if they can contribute. I enjoy providing models and helping people, and would love to be able to spend even more time doing it, as well as expanding into new projects like fine tuning/training.
275
+
276
+ If you're able and willing to contribute it will be most gratefully received and will help me to keep providing more models, and to start work on new AI projects.
277
+
278
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
279
+
280
+ * Patreon: https://patreon.com/TheBlokeAI
281
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
282
+
283
+ **Special thanks to**: Aemon Algiz.
284
+
285
+ **Patreon special mentions**: Sam, theTransient, Jonathan Leane, Steven Wood, webtim, Johann-Peter Hartmann, Geoffrey Montalvo, Gabriel Tamborski, Willem Michiel, John Villwock, Derek Yates, Mesiah Bishop, Eugene Pentland, Pieter, Chadd, Stephen Murray, Daniel P. Andersen, terasurfer, Brandon Frisco, Thomas Belote, Sid, Nathan LeClaire, Magnesian, Alps Aficionado, Stanislav Ovsiannikov, Alex, Joseph William Delisle, Nikolai Manek, Michael Davis, Junyu Yang, K, J, Spencer Kim, Stefan Sabev, Olusegun Samson, transmissions 11, Michael Levine, Cory Kujawski, Rainer Wilmers, zynix, Kalila, Luke @flexchar, Ajan Kanaga, Mandus, vamX, Ai Maven, Mano Prime, Matthew Berman, subjectnull, Vitor Caleffi, Clay Pascal, biorpg, alfie_i, 阿明, Jeffrey Morgan, ya boyyy, Raymond Fosdick, knownsqashed, Olakabola, Leonard Tan, ReadyPlayerEmma, Enrico Ros, Dave, Talal Aujan, Illia Dulskyi, Sean Connelly, senxiiz, Artur Olbinski, Elle, Raven Klaugh, Fen Risland, Deep Realms, Imad Khwaja, Fred von Graf, Will Dee, usrbinkat, SuperWojo, Alexandros Triantafyllidis, Swaroop Kallakuri, Dan Guido, John Detwiler, Pedro Madruga, Iucharbius, Viktor Bowallius, Asp the Wyvern, Edmond Seymore, Trenton Dambrowitz, Space Cruiser, Spiking Neurons AB, Pyrater, LangChain4j, Tony Hughes, Kacper Wikieł, Rishabh Srivastava, David Ziegler, Luke Pendergrass, Andrey, Gabriel Puliatti, Lone Striker, Sebastain Graf, Pierre Kircher, Randy H, NimbleBox.ai, Vadim, danny, Deo Leter
286
+
287
+
288
+ Thank you to all my generous patrons and donaters!
289
+
290
+ And thank you again to a16z for their generous grant.
291
+
292
+ <!-- footer end -->
293
+
294
+ # Original model card
295
+
296
+ # Code Llama
297
+
298
+ ## **Model Details**
299
+
300
+ **Model Developers** Meta AI
301
+
302
+ **Variations** Code Llama comes in three model sizes, and three variants:
303
+ 1) Code Llama: our base models designed for general code synthesis and understanding
304
+ 2) Code Llama - Python: designed specifically for Python
305
+ 3) Code Llama - Instruct: for instruction following and safer deployment
306
+
307
+ All variants are available in sizes of 7B, 13B and 34B parameters.
308
+
309
+ **Input** Models input text only.
310
+
311
+ **Output** Models output text only.
312
+
313
+ **Model Architecture** Code Llama and its variants are autoregressive language models using optimized transformer architectures. Code Llama 7B and 13B additionally support infilling text generation. All models were fine-tuned with up to 16K tokens, and support up to 100K tokens at inference time.
314
+
315
+ **Model Dates** Code Llama and its variants have been trained between January 2023 and July 2023.
316
+
317
+ **Status** This is a static model trained on an offline dataset. Future versions of Code Llama - Instruct will be released as we improve model safety with community feedback.
318
+
319
+ **Licence** A custom commercial license is available at: [https://ai.meta.com/resources/models-and-libraries/llama-downloads/](https://ai.meta.com/resources/models-and-libraries/llama-downloads/).
320
+
321
+ **Research Paper** More information can be found in the paper "[Code Llama: Open Foundation Models for Code](https://ai.meta.com/research/publications/code-llama-open-foundation-models-for-code/)".
322
+
323
+ **Where to send comments** Instructions on how to provide feedback or comments on the model can be found in the model [README](README.md), or by opening an issue in the GitHub repository ([https://github.com/facebookresearch/codellama/](https://github.com/facebookresearch/codellama/)).
324
+
325
+ ## **Intended Use**
326
+ **Intended Use Cases** Code Llama and its variants is intended for commercial and research use in English and relevant programming languages. The base model Code Llama can be adapted for a variety of code synthesis and understanding tasks, Code Llama - Python is designed specifically to handle the Python programming language, and Code Llama - Instruct is intended to be safer to use for code assistant and generation applications.
327
+
328
+ **Out-of-Scope Uses** Use in any manner that violates applicable laws or regulations (including trade compliance laws). Use in languages other than English. Use in any other way that is prohibited by the Acceptable Use Policy and Licensing Agreement for Code Llama and its variants.
329
+
330
+ ## **Hardware and Software**
331
+ **Training Factors**
332
+ We used custom training libraries. The training and fine-tuning of the released models have been performed Meta’s Research Super Cluster.
333
+
334
+ **Carbon Footprint** In aggregate, training all 9 Code Llama models required 400K GPU hours of computation on hardware of type A100-80GB (TDP of 350-400W). Estimated total emissions were 65.3 tCO2eq, 100% of which were offset by Meta’s sustainability program.
335
+
336
+ **Training data**
337
+ All experiments reported here and the released models have been trained and fine-tuned using the same data as Llama 2 with different weights (see Section 2 and Table 1 in the [research paper](https://ai.meta.com/research/publications/code-llama-open-foundation-models-for-code/) for details).
338
+ Code Llama - Instruct uses additional instruction fine-tuning data.
339
+
340
+ **Evaluation Results**
341
+ See evaluations for the main models and detailed ablations in Section 3 and safety evaluations in Section 4 of the research paper.
342
+
343
+ ## **Ethical Considerations and Limitations**
344
+ 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.
345
+
346
+ Please see the Responsible Use Guide available available at [https://ai.meta.com/llama/responsible-user-guide](https://ai.meta.com/llama/responsible-user-guide).
347
+