SalmanFaroz commited on
Commit
196940e
·
verified ·
1 Parent(s): ea6fd56

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +311 -0
README.md ADDED
@@ -0,0 +1,311 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ pipeline_tag: text-generation
5
+ tags:
6
+ - facebook
7
+ - meta
8
+ - pytorch
9
+ - llama
10
+ - llama-3
11
+ license: llama3
12
+ extra_gated_prompt: >-
13
+ ### META LLAMA 3 COMMUNITY LICENSE AGREEMENT
14
+
15
+ Meta Llama 3 Version Release Date: April 18, 2024
16
+
17
+ "Agreement" means the terms and conditions for use, reproduction, distribution and modification of the
18
+ Llama Materials set forth herein.
19
+
20
+ "Documentation" means the specifications, manuals and documentation accompanying Meta Llama 3
21
+ distributed by Meta at https://llama.meta.com/get-started/.
22
+
23
+ "Licensee" or "you" means you, or your employer or any other person or entity (if you are entering into
24
+ this Agreement on such person or entity’s behalf), of the age required under applicable laws, rules or
25
+ regulations to provide legal consent and that has legal authority to bind your employer or such other
26
+ person or entity if you are entering in this Agreement on their behalf.
27
+
28
+ "Meta Llama 3" means the foundational large language models and software and algorithms, including
29
+ machine-learning model code, trained model weights, inference-enabling code, training-enabling code,
30
+ fine-tuning enabling code and other elements of the foregoing distributed by Meta at
31
+ https://llama.meta.com/llama-downloads.
32
+
33
+ "Llama Materials" means, collectively, Meta’s proprietary Meta Llama 3 and Documentation (and any
34
+ portion thereof) made available under this Agreement.
35
+
36
+ "Meta" or "we" means Meta Platforms Ireland Limited (if you are located in or, if you are an entity, your
37
+ principal place of business is in the EEA or Switzerland) and Meta Platforms, Inc. (if you are located
38
+ outside of the EEA or Switzerland).
39
+
40
+ 1. License Rights and Redistribution.
41
+
42
+ a. Grant of Rights. You are granted a non-exclusive, worldwide, non-transferable and royalty-free
43
+ limited license under Meta’s intellectual property or other rights owned by Meta embodied in the Llama
44
+ Materials to use, reproduce, distribute, copy, create derivative works of, and make modifications to the
45
+ Llama Materials.
46
+
47
+ b. Redistribution and Use.
48
+
49
+ i. If you distribute or make available the Llama Materials (or any derivative works
50
+ thereof), or a product or service that uses any of them, including another AI model, you shall (A) provide
51
+ a copy of this Agreement with any such Llama Materials; and (B) prominently display “Built with Meta
52
+ Llama 3” on a related website, user interface, blogpost, about page, or product documentation. If you
53
+ use the Llama Materials to create, train, fine tune, or otherwise improve an AI model, which is
54
+ distributed or made available, you shall also include “Llama 3” at the beginning of any such AI model
55
+ name.
56
+
57
+ ii. If you receive Llama Materials, or any derivative works thereof, from a Licensee as part
58
+ of an integrated end user product, then Section 2 of this Agreement will not apply to you.
59
+
60
+ iii. You must retain in all copies of the Llama Materials that you distribute the following
61
+ attribution notice within a “Notice” text file distributed as a part of such copies: “Meta Llama 3 is
62
+ licensed under the Meta Llama 3 Community License, Copyright © Meta Platforms, Inc. All Rights
63
+ Reserved.”
64
+
65
+ iv. Your use of the Llama Materials must comply with applicable laws and regulations
66
+ (including trade compliance laws and regulations) and adhere to the Acceptable Use Policy for the Llama
67
+ Materials (available at https://llama.meta.com/llama3/use-policy), which is hereby incorporated by
68
+ reference into this Agreement.
69
+
70
+ v. You will not use the Llama Materials or any output or results of the Llama Materials to
71
+ improve any other large language model (excluding Meta Llama 3 or derivative works thereof).
72
+
73
+ 2. Additional Commercial Terms. If, on the Meta Llama 3 version release date, the monthly active users
74
+ of the products or services made available by or for Licensee, or Licensee’s affiliates, is greater than 700
75
+ million monthly active users in the preceding calendar month, you must request a license from Meta,
76
+ which Meta may grant to you in its sole discretion, and you are not authorized to exercise any of the
77
+ rights under this Agreement unless or until Meta otherwise expressly grants you such rights.
78
+
79
+ 3. Disclaimer of Warranty. UNLESS REQUIRED BY APPLICABLE LAW, THE LLAMA MATERIALS AND ANY
80
+ OUTPUT AND RESULTS THEREFROM ARE PROVIDED ON AN “AS IS” BASIS, WITHOUT WARRANTIES OF
81
+ ANY KIND, AND META DISCLAIMS ALL WARRANTIES OF ANY KIND, BOTH EXPRESS AND IMPLIED,
82
+ INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OF TITLE, NON-INFRINGEMENT,
83
+ MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. YOU ARE SOLELY RESPONSIBLE FOR
84
+ DETERMINING THE APPROPRIATENESS OF USING OR REDISTRIBUTING THE LLAMA MATERIALS AND
85
+ ASSUME ANY RISKS ASSOCIATED WITH YOUR USE OF THE LLAMA MATERIALS AND ANY OUTPUT AND
86
+ RESULTS.
87
+
88
+ 4. Limitation of Liability. IN NO EVENT WILL META OR ITS AFFILIATES BE LIABLE UNDER ANY THEORY OF
89
+ LIABILITY, WHETHER IN CONTRACT, TORT, NEGLIGENCE, PRODUCTS LIABILITY, OR OTHERWISE, ARISING
90
+ OUT OF THIS AGREEMENT, FOR ANY LOST PROFITS OR ANY INDIRECT, SPECIAL, CONSEQUENTIAL,
91
+ INCIDENTAL, EXEMPLARY OR PUNITIVE DAMAGES, EVEN IF META OR ITS AFFILIATES HAVE BEEN ADVISED
92
+ OF THE POSSIBILITY OF ANY OF THE FOREGOING.
93
+
94
+ 5. Intellectual Property.
95
+
96
+ a. No trademark licenses are granted under this Agreement, and in connection with the Llama
97
+ Materials, neither Meta nor Licensee may use any name or mark owned by or associated with the other
98
+ or any of its affiliates, except as required for reasonable and customary use in describing and
99
+ redistributing the Llama Materials or as set forth in this Section 5(a). Meta hereby grants you a license to
100
+ use “Llama 3” (the “Mark”) solely as required to comply with the last sentence of Section 1.b.i. You will
101
+ comply with Meta’s brand guidelines (currently accessible at
102
+ https://about.meta.com/brand/resources/meta/company-brand/ ). All goodwill arising out of your use
103
+ of the Mark will inure to the benefit of Meta.
104
+
105
+ b. Subject to Meta’s ownership of Llama Materials and derivatives made by or for Meta, with
106
+ respect to any derivative works and modifications of the Llama Materials that are made by you, as
107
+ between you and Meta, you are and will be the owner of such derivative works and modifications.
108
+
109
+ c. If you institute litigation or other proceedings against Meta or any entity (including a
110
+ cross-claim or counterclaim in a lawsuit) alleging that the Llama Materials or Meta Llama 3 outputs or
111
+ results, or any portion of any of the foregoing, constitutes infringement of intellectual property or other
112
+ rights owned or licensable by you, then any licenses granted to you under this Agreement shall
113
+ terminate as of the date such litigation or claim is filed or instituted. You will indemnify and hold
114
+ harmless Meta from and against any claim by any third party arising out of or related to your use or
115
+ distribution of the Llama Materials.
116
+
117
+ 6. Term and Termination. The term of this Agreement will commence upon your acceptance of this
118
+ Agreement or access to the Llama Materials and will continue in full force and effect until terminated in
119
+ accordance with the terms and conditions herein. Meta may terminate this Agreement if you are in
120
+ breach of any term or condition of this Agreement. Upon termination of this Agreement, you shall delete
121
+ and cease use of the Llama Materials. Sections 3, 4 and 7 shall survive the termination of this
122
+ Agreement.
123
+
124
+ 7. Governing Law and Jurisdiction. This Agreement will be governed and construed under the laws of
125
+ the State of California without regard to choice of law principles, and the UN Convention on Contracts
126
+ for the International Sale of Goods does not apply to this Agreement. The courts of California shall have
127
+ exclusive jurisdiction of any dispute arising out of this Agreement.
128
+
129
+ ### Meta Llama 3 Acceptable Use Policy
130
+
131
+ Meta is committed to promoting safe and fair use of its tools and features, including Meta Llama 3. If you
132
+ access or use Meta Llama 3, you agree to this Acceptable Use Policy (“Policy”). The most recent copy of
133
+ this policy can be found at [https://llama.meta.com/llama3/use-policy](https://llama.meta.com/llama3/use-policy)
134
+
135
+ #### Prohibited Uses
136
+
137
+ We want everyone to use Meta Llama 3 safely and responsibly. You agree you will not use, or allow
138
+ others to use, Meta Llama 3 to:
139
+ 1. Violate the law or others’ rights, including to:
140
+ 1. Engage in, promote, generate, contribute to, encourage, plan, incite, or further illegal or unlawful activity or content, such as:
141
+ 1. Violence or terrorism
142
+ 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
143
+ 3. Human trafficking, exploitation, and sexual violence
144
+ 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.
145
+ 5. Sexual solicitation
146
+ 6. Any other criminal activity
147
+ 2. Engage in, promote, incite, or facilitate the harassment, abuse, threatening, or bullying of individuals or groups of individuals
148
+ 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
149
+ 4. Engage in the unauthorized or unlicensed practice of any profession including, but not limited to, financial, legal, medical/health, or related professional practices
150
+ 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
151
+ 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 Materials
152
+ 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
153
+ 2. Engage in, promote, incite, facilitate, or assist in the planning or development of activities that present a risk of death or bodily harm to individuals, including use of Meta Llama 3 related to the following:
154
+ 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
155
+ 2. Guns and illegal weapons (including weapon development)
156
+ 3. Illegal drugs and regulated/controlled substances
157
+ 4. Operation of critical infrastructure, transportation technologies, or heavy machinery
158
+ 5. Self-harm or harm to others, including suicide, cutting, and eating disorders
159
+ 6. Any content intended to incite or promote violence, abuse, or any infliction of bodily harm to an individual
160
+ 3. Intentionally deceive or mislead others, including use of Meta Llama 3 related to the following:
161
+ 1. Generating, promoting, or furthering fraud or the creation or promotion of disinformation
162
+ 2. Generating, promoting, or furthering defamatory content, including the creation of defamatory statements, images, or other content
163
+ 3. Generating, promoting, or further distributing spam
164
+ 4. Impersonating another individual without consent, authorization, or legal right
165
+ 5. Representing that the use of Meta Llama 3 or outputs are human-generated
166
+ 6. Generating or facilitating false online engagement, including fake reviews and other means of fake online engagement
167
+ 4. Fail to appropriately disclose to end users any known dangers of your AI system
168
+
169
+ Please report any violation of this Policy, software “bug,” or other problems that could lead to a violation
170
+ of this Policy through one of the following means:
171
+ * Reporting issues with the model: [https://github.com/meta-llama/llama3](https://github.com/meta-llama/llama3)
172
+ * Reporting risky content generated by the model:
173
+ developers.facebook.com/llama_output_feedback
174
+ * Reporting bugs and security concerns: facebook.com/whitehat/info
175
+ * Reporting violations of the Acceptable Use Policy or unlicensed uses of Meta Llama 3: LlamaUseReport@meta.com
176
+ extra_gated_fields:
177
+ First Name: text
178
+ Last Name: text
179
+ Date of birth: date_picker
180
+ Country: country
181
+ Affiliation: text
182
+ geo: ip_location
183
+ 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
184
+ 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/).
185
+ extra_gated_button_content: Submit
186
+ ---
187
+
188
+ ## Model Details (AWQ 4bit)
189
+
190
+ Meta developed and released the Meta Llama 3 family of large language models (LLMs), a collection of pretrained and instruction tuned generative text models in 8 and 70B sizes. The Llama 3 instruction tuned models are optimized for dialogue use cases and outperform many of the available open source chat models on common industry benchmarks. Further, in developing these models, we took great care to optimize helpfulness and safety.
191
+
192
+ **Model developers** Meta
193
+
194
+ **Variations** Llama 3 comes in two sizes — 8B and 70B parameters — in pre-trained and instruction tuned variants.
195
+
196
+ **Input** Models input text only.
197
+
198
+ **Output** Models generate text and code only.
199
+
200
+ **Model Architecture** Llama 3 is an auto-regressive language model that uses an optimized transformer architecture. The tuned versions use supervised fine-tuning (SFT) and reinforcement learning with human feedback (RLHF) to align with human preferences for helpfulness and safety.
201
+
202
+
203
+ <table>
204
+ <tr>
205
+ <td>
206
+ </td>
207
+ <td><strong>Training Data</strong>
208
+ </td>
209
+ <td><strong>Params</strong>
210
+ </td>
211
+ <td><strong>Context length</strong>
212
+ </td>
213
+ <td><strong>GQA</strong>
214
+ </td>
215
+ <td><strong>Token count</strong>
216
+ </td>
217
+ <td><strong>Knowledge cutoff</strong>
218
+ </td>
219
+ </tr>
220
+ <tr>
221
+ <td rowspan="2" >Llama 3
222
+ </td>
223
+ <td rowspan="2" >A new mix of publicly available online data.
224
+ </td>
225
+ <td>8B
226
+ </td>
227
+ <td>8k
228
+ </td>
229
+ <td>Yes
230
+ </td>
231
+ <td rowspan="2" >15T+
232
+ </td>
233
+ <td>March, 2023
234
+ </td>
235
+ </tr>
236
+ <tr>
237
+ <td>70B
238
+ </td>
239
+ <td>8k
240
+ </td>
241
+ <td>Yes
242
+ </td>
243
+ <td>December, 2023
244
+ </td>
245
+ </tr>
246
+ </table>
247
+
248
+
249
+ **Llama 3 family of models**. Token counts refer to pretraining data only. Both the 8 and 70B versions use Grouped-Query Attention (GQA) for improved inference scalability.
250
+
251
+ **Model Release Date** April 18, 2024.
252
+
253
+ **Status** This is a static model trained on an offline dataset. Future versions of the tuned models will be released as we improve model safety with community feedback.
254
+
255
+ **License** A custom commercial license is available at: [https://llama.meta.com/llama3/license](https://llama.meta.com/llama3/license)
256
+
257
+ Where to send questions or comments about the model Instructions on how to provide feedback or comments on the model can be found in the model [README](https://github.com/meta-llama/llama3). For more technical information about generation parameters and recipes for how to use Llama 3 in applications, please go [here](https://github.com/meta-llama/llama-recipes).
258
+
259
+
260
+ ## Intended Use
261
+
262
+ **Intended Use Cases** Llama 3 is intended for commercial and research use in English. Instruction tuned models are intended for assistant-like chat, whereas pretrained models can be adapted for a variety of natural language generation tasks.
263
+
264
+ **Out-of-scope** Use in any manner that violates applicable laws or regulations (including trade compliance laws). Use in any other way that is prohibited by the Acceptable Use Policy and Llama 3 Community License. Use in languages other than English**.
265
+
266
+ **Note: Developers may fine-tune Llama 3 models for languages beyond English provided they comply with the Llama 3 Community License and the Acceptable Use Policy.
267
+
268
+ #### First install the package
269
+
270
+ Run one of the following commands, according to your system:
271
+
272
+ ```shell
273
+ # Base ctransformers with no GPU acceleration
274
+ pip install llama-cpp-python
275
+ # With NVidia CUDA acceleration
276
+ CMAKE_ARGS="-DLLAMA_CUBLAS=on" pip install llama-cpp-python
277
+ # Or with OpenBLAS acceleration
278
+ CMAKE_ARGS="-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS" pip install llama-cpp-python
279
+ # Or with CLBLast acceleration
280
+ CMAKE_ARGS="-DLLAMA_CLBLAST=on" pip install llama-cpp-python
281
+ # Or with AMD ROCm GPU acceleration (Linux only)
282
+ CMAKE_ARGS="-DLLAMA_HIPBLAS=on" pip install llama-cpp-python
283
+ # Or with Metal GPU acceleration for macOS systems only
284
+ CMAKE_ARGS="-DLLAMA_METAL=on" pip install llama-cpp-python
285
+
286
+ # In windows, to set the variables CMAKE_ARGS in PowerShell, follow this format; eg for NVidia CUDA:
287
+ $env:CMAKE_ARGS = "-DLLAMA_OPENBLAS=on"
288
+ pip install llama-cpp-python
289
+ ```
290
+
291
+ #### Simple llama-cpp-python example code
292
+
293
+ ```python
294
+ from llama_cpp import Llama
295
+
296
+ # Set gpu_layers to the number of layers to offload to GPU. Set to 0 if no GPU acceleration is available on your system.
297
+ llm = Llama(
298
+ model_path="./Q4_K_M.gguf", # Download the model file first
299
+ n_ctx=4096, # The max sequence length to use - note that longer sequence lengths require much more resources
300
+ n_threads=8, # The number of CPU threads to use, tailor to your system and the resulting performance
301
+ n_gpu_layers=35 # The number of layers to offload to GPU, if you have GPU acceleration available
302
+ )
303
+
304
+ output = llm(
305
+ "what is life?", # Prompt
306
+ max_tokens=10, # Generate up to 512 tokens
307
+ stop=["</s>"], # Example stop token - not necessarily correct for this specific model! Please check before using.
308
+ echo=True , # Whether to echo the prompt
309
+ temperature=0.001
310
+ )
311
+ ```