RichardErkhov commited on
Commit
760d2c6
1 Parent(s): 0750bcb

uploaded readme

Browse files
Files changed (1) hide show
  1. README.md +277 -0
README.md ADDED
@@ -0,0 +1,277 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Quantization made by Richard Erkhov.
2
+
3
+ [Github](https://github.com/RichardErkhov)
4
+
5
+ [Discord](https://discord.gg/pvy7H8DZMG)
6
+
7
+ [Request more models](https://github.com/RichardErkhov/quant_request)
8
+
9
+
10
+ CodeLlama-34b-Instruct-hf - bnb 4bits
11
+ - Model creator: https://huggingface.co/meta-llama/
12
+ - Original model: https://huggingface.co/meta-llama/CodeLlama-34b-Instruct-hf/
13
+
14
+
15
+
16
+
17
+ Original model description:
18
+ ---
19
+ extra_gated_heading: You need to share contact information with Meta to access this model
20
+ extra_gated_prompt: >-
21
+ ### LLAMA 2 COMMUNITY LICENSE AGREEMENT
22
+
23
+ "Agreement" means the terms and conditions for use, reproduction, distribution
24
+ and modification of the Llama Materials set forth herein.
25
+ "Documentation" means the specifications, manuals and documentation
26
+ accompanying Llama 2 distributed by Meta at
27
+ https://ai.meta.com/resources/models-and-libraries/llama-downloads/.
28
+ "Licensee" or "you" means you, or your employer or any other person or entity
29
+ (if you are entering into this Agreement on such person or entity's behalf),
30
+ of the age required under applicable laws, rules or regulations to provide
31
+ legal consent and that has legal authority to bind your employer or such other
32
+ person or entity if you are entering in this Agreement on their behalf.
33
+ "Llama 2" means the foundational large language models and software and
34
+ algorithms, including machine-learning model code, trained model weights,
35
+ inference-enabling code, training-enabling code, fine-tuning enabling code and
36
+ other elements of the foregoing distributed by Meta at
37
+ ai.meta.com/resources/models-and-libraries/llama-downloads/.
38
+ "Llama Materials" means, collectively, Meta's proprietary Llama 2 and
39
+ documentation (and any portion thereof) made available under this Agreement.
40
+ "Meta" or "we" means Meta Platforms Ireland Limited (if you are located in or,
41
+ if you are an entity, your principal place of business is in the EEA or
42
+ Switzerland) and Meta Platforms, Inc. (if you are located outside of the EEA
43
+ or Switzerland).
44
+ By clicking "I Accept" below or by using or distributing any portion or
45
+ element of the Llama Materials, you agree to be bound by this Agreement.
46
+ 1. License Rights and Redistribution.
47
+ a. Grant of Rights. You are granted a non-exclusive, worldwide, non-
48
+ transferable and royalty-free limited license under Meta's intellectual
49
+ property or other rights owned by Meta embodied in the Llama Materials to
50
+ use, reproduce, distribute, copy, create derivative works of, and make
51
+ modifications to the Llama Materials.
52
+
53
+ b. Redistribution and Use.
54
+ i. If you distribute or make the Llama Materials, or any derivative works
55
+ thereof, available to a third party, you shall provide a copy of this
56
+ Agreement to such third party.
57
+ ii. If you receive Llama Materials, or any derivative works thereof, from a
58
+ Licensee as part of an integrated end user product, then Section 2 of this
59
+ Agreement will not apply to you.
60
+ iii. You must retain in all copies of the Llama Materials that you distribute
61
+ the following attribution notice within a "Notice" text file distributed as a
62
+ part of such copies: "Llama 2 is licensed under the LLAMA 2 Community
63
+ License, Copyright (c) Meta Platforms, Inc. All Rights Reserved."
64
+ iv. Your use of the Llama Materials must comply with applicable laws and
65
+ regulations (including trade compliance laws and regulations) and adhere to
66
+ the Acceptable Use Policy for the Llama Materials (available at
67
+ https://ai.meta.com/llama/use-policy), which is hereby incorporated by
68
+ reference into this Agreement.
69
+ v. You will not use the Llama Materials or any output or results of the Llama
70
+ Materials to improve any other large language model (excluding Llama 2 or
71
+ derivative works thereof).
72
+ 2. Additional Commercial Terms. If, on the Llama 2 version release date, the
73
+ monthly active users of the products or services made available by or for
74
+ Licensee, or Licensee's affiliates, is greater than 700 million monthly
75
+ active users in the preceding calendar month, you must request a license from
76
+ Meta, which Meta may grant to you in its sole discretion, and you are not
77
+ authorized to exercise any of the rights under this Agreement unless or until
78
+ Meta otherwise expressly grants you such rights.
79
+ 3. Disclaimer of Warranty. UNLESS REQUIRED BY APPLICABLE LAW, THE LLAMA
80
+ MATERIALS AND ANY OUTPUT AND RESULTS THEREFROM ARE PROVIDED ON AN "AS IS"
81
+ BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING,
82
+ WITHOUT LIMITATION, ANY WARRANTIES OF TITLE, NON-INFRINGEMENT,
83
+ MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. YOU ARE SOLELY
84
+ RESPONSIBLE FOR DETERMINING THE APPROPRIATENESS OF USING OR REDISTRIBUTING
85
+ THE LLAMA MATERIALS AND ASSUME ANY RISKS ASSOCIATED WITH YOUR USE OF THE
86
+ LLAMA MATERIALS AND ANY OUTPUT AND RESULTS.
87
+ 4. Limitation of Liability. IN NO EVENT WILL META OR ITS AFFILIATES BE LIABLE
88
+ UNDER ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, TORT, NEGLIGENCE,
89
+ PRODUCTS LIABILITY, OR OTHERWISE, ARISING OUT OF THIS AGREEMENT, FOR ANY LOST
90
+ PROFITS OR ANY INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL, EXEMPLARY OR
91
+ PUNITIVE DAMAGES, EVEN IF META OR ITS AFFILIATES HAVE BEEN ADVISED OF THE
92
+ POSSIBILITY OF ANY OF THE FOREGOING.
93
+ 5. Intellectual Property.
94
+ a. No trademark licenses are granted under this Agreement, and in connection
95
+ with the Llama Materials, neither Meta nor Licensee may use any name or mark
96
+ owned by or associated with the other or any of its affiliates, except as
97
+ required for reasonable and customary use in describing and redistributing
98
+ the Llama Materials.
99
+ b. Subject to Meta's ownership of Llama Materials and derivatives made by or
100
+ for Meta, with respect to any derivative works and modifications of the Llama
101
+ Materials that are made by you, as between you and Meta, you are and will be
102
+ the owner of such derivative works and modifications.
103
+ c. If you institute litigation or other proceedings against Meta or any
104
+ entity (including a cross-claim or counterclaim in a lawsuit) alleging that
105
+ the Llama Materials or Llama 2 outputs or results, or any portion of any of
106
+ the foregoing, constitutes infringement of intellectual property or other
107
+ rights owned or licensable by you, then any licenses granted to you under
108
+ this Agreement shall terminate as of the date such litigation or claim is
109
+ filed or instituted. You will indemnify and hold harmless Meta from and
110
+ against any claim by any third party arising out of or related to your use or
111
+ distribution of the Llama Materials.
112
+ 6. Term and Termination. The term of this Agreement will commence upon your
113
+ acceptance of this Agreement or access to the Llama Materials and will
114
+ continue in full force and effect until terminated in accordance with the
115
+ terms and conditions herein. Meta may terminate this Agreement if you are in
116
+ breach of any term or condition of this Agreement. Upon termination of this
117
+ Agreement, you shall delete and cease use of the Llama Materials. Sections 3,
118
+ 4 and 7 shall survive the termination of this Agreement.
119
+ 7. Governing Law and Jurisdiction. This Agreement will be governed and
120
+ construed under the laws of the State of California without regard to choice
121
+ of law principles, and the UN Convention on Contracts for the International
122
+ Sale of Goods does not apply to this Agreement. The courts of California
123
+ shall have exclusive jurisdiction of any dispute arising out of this
124
+ Agreement.
125
+ USE POLICY
126
+ ### Llama 2 Acceptable Use Policy
127
+ Meta is committed to promoting safe and fair use of its tools and features,
128
+ including Llama 2. If you access or use Llama 2, you agree to this Acceptable
129
+ Use Policy (“Policy”). The most recent copy of this policy can be found at
130
+ [ai.meta.com/llama/use-policy](http://ai.meta.com/llama/use-policy).
131
+ #### Prohibited Uses
132
+ We want everyone to use Llama 2 safely and responsibly. You agree you will not
133
+ use, or allow others to use, Llama 2 to:
134
+ 1. Violate the law or others’ rights, including to:
135
+ 1. Engage in, promote, generate, contribute to, encourage, plan, incite, or further illegal or unlawful activity or content, such as:
136
+ 1. Violence or terrorism
137
+ 2. Exploitation or harm to children, including the solicitation, creation, acquisition, or dissemination of child exploitative content or failure to report Child Sexual Abuse Material
138
+ 3. Human trafficking, exploitation, and sexual violence
139
+ 4. The illegal distribution of information or materials to minors, including obscene materials, or failure to employ legally required age-gating in connection with such information or materials.
140
+ 5. Sexual solicitation
141
+ 6. Any other criminal activity
142
+ 2. Engage in, promote, incite, or facilitate the harassment, abuse, threatening, or bullying of individuals or groups of individuals
143
+ 3. Engage in, promote, incite, or facilitate discrimination or other unlawful or harmful conduct in the provision of employment, employment benefits, credit, housing, other economic benefits, or other essential goods and services
144
+ 4. Engage in the unauthorized or unlicensed practice of any profession including, but not limited to, financial, legal, medical/health, or related professional practices
145
+ 5. Collect, process, disclose, generate, or infer health, demographic, or other sensitive personal or private information about individuals without rights and consents required by applicable laws
146
+ 6. Engage in or facilitate any action or generate any content that infringes, misappropriates, or otherwise violates any third-party rights, including the outputs or results of any products or services using the Llama 2 Materials
147
+ 7. Create, generate, or facilitate the creation of malicious code, malware, computer viruses or do anything else that could disable, overburden, interfere with or impair the proper working, integrity, operation or appearance of a website or computer system
148
+ 2. Engage in, promote, incite, facilitate, or assist in the planning or
149
+ development of activities that present a risk of death or bodily harm to
150
+ individuals, including use of Llama 2 related to the following:
151
+ 1. Military, warfare, nuclear industries or applications, espionage, use for materials or activities that are subject to the International Traffic Arms Regulations (ITAR) maintained by the United States Department of State
152
+ 2. Guns and illegal weapons (including weapon development)
153
+ 3. Illegal drugs and regulated/controlled substances
154
+ 4. Operation of critical infrastructure, transportation technologies, or heavy machinery
155
+ 5. Self-harm or harm to others, including suicide, cutting, and eating disorders
156
+ 6. Any content intended to incite or promote violence, abuse, or any infliction of bodily harm to an individual
157
+ 3. Intentionally deceive or mislead others, including use of Llama 2 related
158
+ to the following:
159
+ 1. Generating, promoting, or furthering fraud or the creation or promotion of disinformation
160
+ 2. Generating, promoting, or furthering defamatory content, including the creation of defamatory statements, images, or other content
161
+ 3. Generating, promoting, or further distributing spam
162
+ 4. Impersonating another individual without consent, authorization, or legal right
163
+ 5. Representing that the use of Llama 2 or outputs are human-generated
164
+ 6. Generating or facilitating false online engagement, including fake reviews and other means of fake online engagement
165
+ 4. Fail to appropriately disclose to end users any known dangers of your AI system
166
+ Please report any violation of this Policy, software “bug,” or other problems
167
+ that could lead to a violation of this Policy through one of the following
168
+ means:
169
+ * Reporting issues with the model:
170
+ [github.com/facebookresearch/llama](http://github.com/facebookresearch/llama)
171
+ * Reporting risky content generated by the model:
172
+ [developers.facebook.com/llama_output_feedback](http://developers.facebook.com/llama_output_feedback)
173
+ * Reporting bugs and security concerns:
174
+ [facebook.com/whitehat/info](http://facebook.com/whitehat/info)
175
+ * Reporting violations of the Acceptable Use Policy or unlicensed uses of
176
+ Llama: [LlamaUseReport@meta.com](mailto:LlamaUseReport@meta.com)
177
+ extra_gated_fields:
178
+ First Name: text
179
+ Last Name: text
180
+ Date of birth: date_picker
181
+ Country: country
182
+ Affiliation: text
183
+ geo: ip_location
184
+ By clicking Submit below I accept the terms of the license and acknowledge that the information I provide will be collected stored processed and shared in accordance with the Meta Privacy Policy: checkbox
185
+ extra_gated_description: The information you provide will be collected, stored, processed and shared in accordance with the [Meta Privacy Policy](https://www.facebook.com/privacy/policy/).
186
+ extra_gated_button_content: Submit
187
+ language:
188
+ - code
189
+ pipeline_tag: text-generation
190
+ tags:
191
+ - facebook
192
+ - meta
193
+ - pytorch
194
+ - llama
195
+ - llama-2
196
+ license: llama2
197
+ ---
198
+
199
+ # **Code Llama**
200
+ Code Llama is a collection of pretrained and fine-tuned generative text models ranging in scale from 7 billion to 34 billion parameters. This is the repository for the 34B instruct-tuned 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.
201
+
202
+ | | Base Model | Python | Instruct |
203
+ | --- | ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
204
+ | 7B | [meta-llama/CodeLlama-7b-hf](https://huggingface.co/meta-llama/CodeLlama-7b-hf) | [meta-llama/CodeLlama-7b-Python-hf](https://huggingface.co/meta-llama/CodeLlama-7b-Python-hf) | [meta-llama/CodeLlama-7b-Instruct-hf](https://huggingface.co/meta-llama/CodeLlama-7b-Instruct-hf) |
205
+ | 13B | [meta-llama/CodeLlama-13b-hf](https://huggingface.co/meta-llama/CodeLlama-13b-hf) | [meta-llama/CodeLlama-13b-Python-hf](https://huggingface.co/meta-llama/CodeLlama-13b-Python-hf) | [meta-llama/CodeLlama-13b-Instruct-hf](https://huggingface.co/meta-llama/CodeLlama-13b-Instruct-hf) |
206
+ | 34B | [meta-llama/CodeLlama-34b-hf](https://huggingface.co/meta-llama/CodeLlama-34b-hf) | [meta-llama/CodeLlama-34b-Python-hf](https://huggingface.co/meta-llama/CodeLlama-34b-Python-hf) | [meta-llama/CodeLlama-34b-Instruct-hf](https://huggingface.co/meta-llama/CodeLlama-34b-Instruct-hf) |
207
+ | 70B | [meta-llama/CodeLlama-70b-hf](https://huggingface.co/meta-llama/CodeLlama-70b-hf) | [meta-llama/CodeLlama-70b-Python-hf](https://huggingface.co/meta-llama/CodeLlama-70b-Python-hf) | [meta-llama/CodeLlama-70b-Instruct-hf](https://huggingface.co/meta-llama/CodeLlama-70b-Instruct-hf) |
208
+
209
+ ## Model Use
210
+
211
+ To use this model, please make sure to install transformers:
212
+
213
+ ```bash
214
+ pip install transformers accelerate
215
+ ```
216
+
217
+ Model capabilities:
218
+
219
+ - [x] Code completion.
220
+ - [ ] Infilling.
221
+ - [x] Instructions / chat.
222
+ - [ ] Python specialist.
223
+
224
+ ## Model Details
225
+ *Note: Use of this model is governed by the Meta license. Meta developed and publicly released the Code Llama family of large language models (LLMs).
226
+
227
+ **Model Developers** Meta
228
+
229
+ **Variations** Code Llama comes in three model sizes, and three variants:
230
+
231
+ * Code Llama: base models designed for general code synthesis and understanding
232
+ * Code Llama - Python: designed specifically for Python
233
+ * Code Llama - Instruct: for instruction following and safer deployment
234
+
235
+ All variants are available in sizes of 7B, 13B and 34B parameters.
236
+
237
+ **This repository contains the Instruct version of the 34B parameters model.**
238
+
239
+ **Input** Models input text only.
240
+
241
+ **Output** Models generate text only.
242
+
243
+ **Model Architecture** Code Llama is an auto-regressive language model that uses an optimized transformer architecture.
244
+
245
+ **Model Dates** Code Llama and its variants have been trained between January 2023 and July 2023.
246
+
247
+ **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.
248
+
249
+ **License** 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/)
250
+
251
+ **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/)" or its [arXiv page](https://arxiv.org/abs/2308.12950).
252
+
253
+ ## Intended Use
254
+ **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.
255
+
256
+ **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.
257
+
258
+ ## Hardware and Software
259
+ **Training Factors** We used custom training libraries. The training and fine-tuning of the released models have been performed Meta’s Research Super Cluster.
260
+
261
+ **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.
262
+
263
+ ## Training Data
264
+
265
+ 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).
266
+
267
+ ## Evaluation Results
268
+
269
+ See evaluations for the main models and detailed ablations in Section 3 and safety evaluations in Section 4 of the research paper.
270
+
271
+
272
+ ## Ethical Considerations and Limitations
273
+
274
+ 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.
275
+
276
+ 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).
277
+