bullerwins commited on
Commit
d228ebf
1 Parent(s): ca6f15f

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +13 -208
README.md CHANGED
@@ -8,188 +8,21 @@ language:
8
  - hi
9
  - es
10
  - th
11
- library_name: transformers
12
- base_model: meta-llama/Meta-Llama-3.1-70B
13
  license: llama3.1
 
14
  pipeline_tag: text-generation
15
  tags:
16
  - facebook
17
  - meta
18
- - pytorch
19
  - llama
20
  - llama-3
21
- extra_gated_prompt: "### LLAMA 3.1 COMMUNITY LICENSE AGREEMENT\nLlama 3.1 Version\
22
- \ Release Date: July 23, 2024\n\"Agreement\" means the terms and conditions for\
23
- \ use, reproduction, distribution and modification of the Llama Materials set forth\
24
- \ herein.\n\"Documentation\" means the specifications, manuals and documentation\
25
- \ accompanying Llama 3.1 distributed by Meta at https://llama.meta.com/doc/overview.\n\
26
- \"Licensee\" or \"you\" means you, or your employer or any other person or entity\
27
- \ (if you are entering into this Agreement on such person or entity’s behalf), of\
28
- \ the age required under applicable laws, rules or regulations to provide legal\
29
- \ consent and that has legal authority to bind your employer or such other person\
30
- \ or entity if you are entering in this Agreement on their behalf.\n\"Llama 3.1\"\
31
- \ means the foundational large language models and software and algorithms, including\
32
- \ machine-learning model code, trained model weights, inference-enabling code, training-enabling\
33
- \ code, fine-tuning enabling code and other elements of the foregoing distributed\
34
- \ by Meta at https://llama.meta.com/llama-downloads.\n\"Llama Materials\" means,\
35
- \ collectively, Meta’s proprietary Llama 3.1 and Documentation (and any portion\
36
- \ thereof) made available under this Agreement.\n\"Meta\" or \"we\" means Meta Platforms\
37
- \ Ireland Limited (if you are located in or, if you are an entity, your principal\
38
- \ place of business is in the EEA or Switzerland) and Meta Platforms, Inc. (if you\
39
- \ are located outside of the EEA or Switzerland).\n \n1. License Rights and Redistribution.\n\
40
- a. Grant of Rights. You are granted a non-exclusive, worldwide, non-transferable\
41
- \ and royalty-free limited license under Meta’s intellectual property or other rights\
42
- \ owned by Meta embodied in the Llama Materials to use, reproduce, distribute, copy,\
43
- \ create derivative works of, and make modifications to the Llama Materials.\nb.\
44
- \ Redistribution and Use.\ni. If you distribute or make available the Llama Materials\
45
- \ (or any derivative works thereof), or a product or service (including another\
46
- \ AI model) that contains any of them, you shall (A) provide a copy of this Agreement\
47
- \ with any such Llama Materials; and (B) prominently display “Built with Llama”\
48
- \ on a related website, user interface, blogpost, about page, or product documentation.\
49
- \ If you use the Llama Materials or any outputs or results of the Llama Materials\
50
- \ to create, train, fine tune, or otherwise improve an AI model, which is distributed\
51
- \ or made available, you shall also include “Llama” at the beginning of any such\
52
- \ AI model name.\nii. If you receive Llama Materials, or any derivative works thereof,\
53
- \ from a Licensee as part of an integrated end user product, then Section 2 of\
54
- \ this Agreement will not apply to you.\niii. You must retain in all copies of the\
55
- \ Llama Materials that you distribute the following attribution notice within a\
56
- \ “Notice” text file distributed as a part of such copies: “Llama 3.1 is licensed\
57
- \ under the Llama 3.1 Community License, Copyright © Meta Platforms, Inc. All Rights\
58
- \ Reserved.”\niv. Your use of the Llama Materials must comply with applicable laws\
59
- \ and regulations (including trade compliance laws and regulations) and adhere to\
60
- \ the Acceptable Use Policy for the Llama Materials (available at https://llama.meta.com/llama3_1/use-policy),\
61
- \ which is hereby incorporated by reference into this Agreement.\n2. Additional\
62
- \ Commercial Terms. If, on the Llama 3.1 version release date, the monthly active\
63
- \ users of the products or services made available by or for Licensee, or Licensee’s\
64
- \ affiliates, is greater than 700 million monthly active users in the preceding\
65
- \ calendar month, you must request a license from Meta, which Meta may grant to\
66
- \ you in its sole discretion, and you are not authorized to exercise any of the\
67
- \ rights under this Agreement unless or until Meta otherwise expressly grants you\
68
- \ such rights.\n3. Disclaimer of Warranty. UNLESS REQUIRED BY APPLICABLE LAW, THE\
69
- \ LLAMA MATERIALS AND ANY OUTPUT AND RESULTS THEREFROM ARE PROVIDED ON AN “AS IS”\
70
- \ BASIS, WITHOUT WARRANTIES OF ANY KIND, AND META DISCLAIMS ALL WARRANTIES OF ANY\
71
- \ KIND, BOTH EXPRESS AND IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES\
72
- \ OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.\
73
- \ YOU ARE SOLELY RESPONSIBLE FOR DETERMINING THE APPROPRIATENESS OF USING OR REDISTRIBUTING\
74
- \ THE LLAMA MATERIALS AND ASSUME ANY RISKS ASSOCIATED WITH YOUR USE OF THE LLAMA\
75
- \ MATERIALS AND ANY OUTPUT AND RESULTS.\n4. Limitation of Liability. IN NO EVENT\
76
- \ WILL META OR ITS AFFILIATES BE LIABLE UNDER ANY THEORY OF LIABILITY, WHETHER IN\
77
- \ CONTRACT, TORT, NEGLIGENCE, PRODUCTS LIABILITY, OR OTHERWISE, ARISING OUT OF THIS\
78
- \ AGREEMENT, FOR ANY LOST PROFITS OR ANY INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL,\
79
- \ EXEMPLARY OR PUNITIVE DAMAGES, EVEN IF META OR ITS AFFILIATES HAVE BEEN ADVISED\
80
- \ OF THE POSSIBILITY OF ANY OF THE FOREGOING.\n5. Intellectual Property.\na. No\
81
- \ trademark licenses are granted under this Agreement, and in connection with the\
82
- \ Llama Materials, neither Meta nor Licensee may use any name or mark owned by or\
83
- \ associated with the other or any of its affiliates, except as required for reasonable\
84
- \ and customary use in describing and redistributing the Llama Materials or as set\
85
- \ forth in this Section 5(a). Meta hereby grants you a license to use “Llama” (the\
86
- \ “Mark”) solely as required to comply with the last sentence of Section 1.b.i.\
87
- \ You will comply with Meta’s brand guidelines (currently accessible at https://about.meta.com/brand/resources/meta/company-brand/\
88
- \ ). All goodwill arising out of your use of the Mark will inure to the benefit\
89
- \ of Meta.\nb. Subject to Meta’s ownership of Llama Materials and derivatives made\
90
- \ by or for Meta, with respect to any derivative works and modifications of the\
91
- \ Llama Materials that are made by you, as between you and Meta, you are and will\
92
- \ be the owner of such derivative works and modifications.\nc. If you institute\
93
- \ litigation or other proceedings against Meta or any entity (including a cross-claim\
94
- \ or counterclaim in a lawsuit) alleging that the Llama Materials or Llama 3.1 outputs\
95
- \ or results, or any portion of any of the foregoing, constitutes infringement of\
96
- \ intellectual property or other rights owned or licensable by you, then any licenses\
97
- \ granted to you under this Agreement shall terminate as of the date such litigation\
98
- \ or claim is filed or instituted. You will indemnify and hold harmless Meta from\
99
- \ and against any claim by any third party arising out of or related to your use\
100
- \ or distribution of the Llama Materials.\n6. Term and Termination. The term of\
101
- \ this Agreement will commence upon your acceptance of this Agreement or access\
102
- \ to the Llama Materials and will continue in full force and effect until terminated\
103
- \ in accordance with the terms and conditions herein. Meta may terminate this Agreement\
104
- \ if you are in breach of any term or condition of this Agreement. Upon termination\
105
- \ of this Agreement, you shall delete and cease use of the Llama Materials. Sections\
106
- \ 3, 4 and 7 shall survive the termination of this Agreement.\n7. Governing Law\
107
- \ and Jurisdiction. This Agreement will be governed and construed under the laws\
108
- \ of the State of California without regard to choice of law principles, and the\
109
- \ UN Convention on Contracts for the International Sale of Goods does not apply\
110
- \ to this Agreement. The courts of California shall have exclusive jurisdiction\
111
- \ of any dispute arising out of this Agreement.\n### Llama 3.1 Acceptable Use Policy\n\
112
- Meta is committed to promoting safe and fair use of its tools and features, including\
113
- \ Llama 3.1. If you access or use Llama 3.1, you agree to this Acceptable Use Policy\
114
- \ (“Policy”). The most recent copy of this policy can be found at [https://llama.meta.com/llama3_1/use-policy](https://llama.meta.com/llama3_1/use-policy)\n\
115
- #### Prohibited Uses\nWe want everyone to use Llama 3.1 safely and responsibly.\
116
- \ You agree you will not use, or allow others to use, Llama 3.1 to:\n 1. Violate\
117
- \ the law or others’ rights, including to:\n 1. Engage in, promote, generate,\
118
- \ contribute to, encourage, plan, incite, or further illegal or unlawful activity\
119
- \ or content, such as:\n 1. Violence or terrorism\n 2. Exploitation\
120
- \ or harm to children, including the solicitation, creation, acquisition, or dissemination\
121
- \ of child exploitative content or failure to report Child Sexual Abuse Material\n\
122
- \ 3. Human trafficking, exploitation, and sexual violence\n 4. The\
123
- \ illegal distribution of information or materials to minors, including obscene\
124
- \ materials, or failure to employ legally required age-gating in connection with\
125
- \ such information or materials.\n 5. Sexual solicitation\n 6. Any\
126
- \ other criminal activity\n 3. Engage in, promote, incite, or facilitate the\
127
- \ harassment, abuse, threatening, or bullying of individuals or groups of individuals\n\
128
- \ 4. Engage in, promote, incite, or facilitate discrimination or other unlawful\
129
- \ or harmful conduct in the provision of employment, employment benefits, credit,\
130
- \ housing, other economic benefits, or other essential goods and services\n 5.\
131
- \ Engage in the unauthorized or unlicensed practice of any profession including,\
132
- \ but not limited to, financial, legal, medical/health, or related professional\
133
- \ practices\n 6. Collect, process, disclose, generate, or infer health, demographic,\
134
- \ or other sensitive personal or private information about individuals without rights\
135
- \ and consents required by applicable laws\n 7. Engage in or facilitate any action\
136
- \ or generate any content that infringes, misappropriates, or otherwise violates\
137
- \ any third-party rights, including the outputs or results of any products or services\
138
- \ using the Llama Materials\n 8. Create, generate, or facilitate the creation\
139
- \ of malicious code, malware, computer viruses or do anything else that could disable,\
140
- \ overburden, interfere with or impair the proper working, integrity, operation\
141
- \ or appearance of a website or computer system\n2. Engage in, promote, incite,\
142
- \ facilitate, or assist in the planning or development of activities that present\
143
- \ a risk of death or bodily harm to individuals, including use of Llama 3.1 related\
144
- \ to the following:\n 1. Military, warfare, nuclear industries or applications,\
145
- \ espionage, use for materials or activities that are subject to the International\
146
- \ Traffic Arms Regulations (ITAR) maintained by the United States Department of\
147
- \ State\n 2. Guns and illegal weapons (including weapon development)\n 3.\
148
- \ Illegal drugs and regulated/controlled substances\n 4. Operation of critical\
149
- \ infrastructure, transportation technologies, or heavy machinery\n 5. Self-harm\
150
- \ or harm to others, including suicide, cutting, and eating disorders\n 6. Any\
151
- \ content intended to incite or promote violence, abuse, or any infliction of bodily\
152
- \ harm to an individual\n3. Intentionally deceive or mislead others, including use\
153
- \ of Llama 3.1 related to the following:\n 1. Generating, promoting, or furthering\
154
- \ fraud or the creation or promotion of disinformation\n 2. Generating, promoting,\
155
- \ or furthering defamatory content, including the creation of defamatory statements,\
156
- \ images, or other content\n 3. Generating, promoting, or further distributing\
157
- \ spam\n 4. Impersonating another individual without consent, authorization,\
158
- \ or legal right\n 5. Representing that the use of Llama 3.1 or outputs are human-generated\n\
159
- \ 6. Generating or facilitating false online engagement, including fake reviews\
160
- \ and other means of fake online engagement\n4. Fail to appropriately disclose to\
161
- \ end users any known dangers of your AI system\nPlease report any violation of\
162
- \ this Policy, software “bug,” or other problems that could lead to a violation\
163
- \ of this Policy through one of the following means:\n * Reporting issues with\
164
- \ the model: [https://github.com/meta-llama/llama-models/issues](https://github.com/meta-llama/llama-models/issues)\n\
165
- \ * Reporting risky content generated by the model:\n developers.facebook.com/llama_output_feedback\n\
166
- \ * Reporting bugs and security concerns: facebook.com/whitehat/info\n * Reporting\
167
- \ violations of the Acceptable Use Policy or unlicensed uses of Meta Llama 3: LlamaUseReport@meta.com"
168
- extra_gated_fields:
169
- First Name: text
170
- Last Name: text
171
- Date of birth: date_picker
172
- Country: country
173
- Affiliation: text
174
- Job title:
175
- type: select
176
- options:
177
- - Student
178
- - Research Graduate
179
- - AI researcher
180
- - AI developer/engineer
181
- - Reporter
182
- - Other
183
- geo: ip_location
184
- ? By clicking Submit below I accept the terms of the license and acknowledge that
185
- the information I provide will be collected stored processed and shared in accordance
186
- with the Meta Privacy Policy
187
- : checkbox
188
- extra_gated_description: The information you provide will be collected, stored, processed
189
- and shared in accordance with the [Meta Privacy Policy](https://www.facebook.com/privacy/policy/).
190
- extra_gated_button_content: Submit
191
  ---
192
 
 
 
 
 
193
  ## Model Information
194
 
195
  The Meta Llama 3.1 collection of multilingual large language models (LLMs) is a collection of pretrained and instruction tuned generative models in 8B, 70B and 405B sizes (text in/text out). The Llama 3.1 instruction tuned text only models (8B, 70B, 405B) are optimized for multilingual dialogue use cases and outperform many of the available open source and closed chat models on common industry benchmarks.
@@ -290,7 +123,7 @@ Where to send questions or comments about the model Instructions on how to provi
290
 
291
  ## How to use
292
 
293
- This repository contains two versions of Meta-Llama-3.1-70B-Instruct, for use with transformers and with the original `llama` codebase.
294
 
295
  ### Use with transformers
296
 
@@ -298,13 +131,11 @@ Starting with `transformers >= 4.43.0` onward, you can run conversational infere
298
 
299
  Make sure to update your transformers installation via `pip install --upgrade transformers`.
300
 
301
- See the snippet below for usage with Transformers:
302
-
303
  ```python
304
  import transformers
305
  import torch
306
 
307
- model_id = "meta-llama/Meta-Llama-3.1-70B-Instruct"
308
 
309
  pipeline = transformers.pipeline(
310
  "text-generation",
@@ -325,6 +156,8 @@ outputs = pipeline(
325
  print(outputs[0]["generated_text"][-1])
326
  ```
327
 
 
 
328
  ### Tool use with transformers
329
 
330
  LLaMA-3.1 supports multiple tool use formats. You can see a full guide to prompt formatting [here](https://llama.meta.com/docs/model-cards-and-prompt-formats/llama3_1/).
@@ -371,44 +204,16 @@ After that, you can `generate()` again to let the model use the tool result in t
371
  see the [LLaMA prompt format docs](https://llama.meta.com/docs/model-cards-and-prompt-formats/llama3_1/) and the Transformers [tool use documentation](https://huggingface.co/docs/transformers/main/chat_templating#advanced-tool-use--function-calling).
372
 
373
 
374
- ### Use with `bitsandbytes`
375
-
376
- The model checkpoints can be used in `8-bit` and `4-bit` for further memory optimisations using `bitsandbytes` and `transformers`
377
-
378
- See the snippet below for usage:
379
-
380
- ```python
381
- import torch
382
- from transformers import AutoModelForCausalLM, AutoTokenizer
383
-
384
- model_id = "meta-llama/Meta-Llama-3.1-70B-Instruct"
385
- quantization_config = BitsAndBytesConfig(load_in_8bit=True)
386
-
387
- quantized_model = AutoModelForCausalLM.from_pretrained(
388
- model_id, device_map="auto", torch_dtype=torch.bfloat16, quantization_config=quantization_config)
389
-
390
- tokenizer = AutoTokenizer.from_pretrained(model_id)
391
- input_text = "What are we having for dinner?"
392
- input_ids = tokenizer(input_text, return_tensors="pt").to("cuda")
393
-
394
- output = quantized_model.generate(**input_ids, max_new_tokens=10)
395
-
396
- print(tokenizer.decode(output[0], skip_special_tokens=True))
397
- ```
398
-
399
- To load in 4-bit simply pass `load_in_4bit=True`
400
-
401
  ### Use with `llama`
402
 
403
- Please, follow the instructions in the [repository](https://github.com/meta-llama/llama).
404
 
405
  To download Original checkpoints, see the example command below leveraging `huggingface-cli`:
406
 
407
  ```
408
- huggingface-cli download meta-llama/Meta-Llama-3.1-70B-Instruct --include "original/*" --local-dir Meta-Llama-3.1-70B-Instruct
409
  ```
410
 
411
-
412
  ## Hardware and Software
413
 
414
  **Training Factors** We used custom training libraries, Meta's custom built GPU cluster, and production infrastructure for pretraining. Fine-tuning, annotation, and evaluation were also performed on production infrastructure.
@@ -1286,4 +1091,4 @@ Finally, we put in place a set of resources including an [output reporting mecha
1286
 
1287
  The core values of Llama 3.1 are openness, inclusivity and helpfulness. It is meant to serve everyone, and to work for a wide range of use cases. It is thus designed to be accessible to people across many different backgrounds, experiences and perspectives. Llama 3.1 addresses users and their needs as they are, without insertion unnecessary judgment or normativity, while reflecting the understanding that even content that may appear problematic in some cases can serve valuable purposes in others. It respects the dignity and autonomy of all users, especially in terms of the values of free thought and expression that power innovation and progress.
1288
 
1289
- But Llama 3.1 is a new technology, and like any new technology, there are risks associated with its use. Testing conducted to date has not covered, nor could it cover, all scenarios. For these reasons, as with all LLMs, Llama 3.1’s potential outputs cannot be predicted in advance, and the model may in some instances produce inaccurate, biased or other objectionable responses to user prompts. Therefore, before deploying any applications of Llama 3.1 models, developers should perform safety testing and tuning tailored to their specific applications of the model. Please refer to available resources including our [Responsible Use Guide](https://llama.meta.com/responsible-use-guide), [Trust and Safety](https://llama.meta.com/trust-and-safety/) solutions, and other [resources](https://llama.meta.com/docs/get-started/) to learn more about responsible development.
 
8
  - hi
9
  - es
10
  - th
 
 
11
  license: llama3.1
12
+ base_model: meta-llama/Meta-Llama-3.1-8B
13
  pipeline_tag: text-generation
14
  tags:
15
  - facebook
16
  - meta
 
17
  - llama
18
  - llama-3
19
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  ---
21
 
22
+ Exl2 quant version using [exllamav2 0.1.9](https://github.com/turboderp/exllamav2/releases/tag/v0.1.9)
23
+
24
+ Update 23/08 - it now includes all the fixes for the tokenizer and chat templates+tool calling
25
+
26
  ## Model Information
27
 
28
  The Meta Llama 3.1 collection of multilingual large language models (LLMs) is a collection of pretrained and instruction tuned generative models in 8B, 70B and 405B sizes (text in/text out). The Llama 3.1 instruction tuned text only models (8B, 70B, 405B) are optimized for multilingual dialogue use cases and outperform many of the available open source and closed chat models on common industry benchmarks.
 
123
 
124
  ## How to use
125
 
126
+ This repository contains two versions of Meta-Llama-3.1-8B-Instruct, for use with transformers and with the original `llama` codebase.
127
 
128
  ### Use with transformers
129
 
 
131
 
132
  Make sure to update your transformers installation via `pip install --upgrade transformers`.
133
 
 
 
134
  ```python
135
  import transformers
136
  import torch
137
 
138
+ model_id = "meta-llama/Meta-Llama-3.1-8B-Instruct"
139
 
140
  pipeline = transformers.pipeline(
141
  "text-generation",
 
156
  print(outputs[0]["generated_text"][-1])
157
  ```
158
 
159
+ Note: You can also find detailed recipes on how to use the model locally, with `torch.compile()`, assisted generations, quantised and more at [`huggingface-llama-recipes`](https://github.com/huggingface/huggingface-llama-recipes)
160
+
161
  ### Tool use with transformers
162
 
163
  LLaMA-3.1 supports multiple tool use formats. You can see a full guide to prompt formatting [here](https://llama.meta.com/docs/model-cards-and-prompt-formats/llama3_1/).
 
204
  see the [LLaMA prompt format docs](https://llama.meta.com/docs/model-cards-and-prompt-formats/llama3_1/) and the Transformers [tool use documentation](https://huggingface.co/docs/transformers/main/chat_templating#advanced-tool-use--function-calling).
205
 
206
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
207
  ### Use with `llama`
208
 
209
+ Please, follow the instructions in the [repository](https://github.com/meta-llama/llama)
210
 
211
  To download Original checkpoints, see the example command below leveraging `huggingface-cli`:
212
 
213
  ```
214
+ huggingface-cli download meta-llama/Meta-Llama-3.1-8B-Instruct --include "original/*" --local-dir Meta-Llama-3.1-8B-Instruct
215
  ```
216
 
 
217
  ## Hardware and Software
218
 
219
  **Training Factors** We used custom training libraries, Meta's custom built GPU cluster, and production infrastructure for pretraining. Fine-tuning, annotation, and evaluation were also performed on production infrastructure.
 
1091
 
1092
  The core values of Llama 3.1 are openness, inclusivity and helpfulness. It is meant to serve everyone, and to work for a wide range of use cases. It is thus designed to be accessible to people across many different backgrounds, experiences and perspectives. Llama 3.1 addresses users and their needs as they are, without insertion unnecessary judgment or normativity, while reflecting the understanding that even content that may appear problematic in some cases can serve valuable purposes in others. It respects the dignity and autonomy of all users, especially in terms of the values of free thought and expression that power innovation and progress.
1093
 
1094
+ But Llama 3.1 is a new technology, and like any new technology, there are risks associated with its use. Testing conducted to date has not covered, nor could it cover, all scenarios. For these reasons, as with all LLMs, Llama 3.1’s potential outputs cannot be predicted in advance, and the model may in some instances produce inaccurate, biased or other objectionable responses to user prompts. Therefore, before deploying any applications of Llama 3.1 models, developers should perform safety testing and tuning tailored to their specific applications of the model. Please refer to available resources including our [Responsible Use Guide](https://llama.meta.com/responsible-use-guide), [Trust and Safety](https://llama.meta.com/trust-and-safety/) solutions, and other [resources](https://llama.meta.com/docs/get-started/) to learn more about responsible development.