Upload 2 files
Browse files
LICENSE
ADDED
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
LLAMA 3.1 COMMUNITY LICENSE AGREEMENT
|
2 |
+
Llama 3.1 Version Release Date: July 23, 2024
|
3 |
+
|
4 |
+
“Agreement” means the terms and conditions for use, reproduction, distribution and modification of the
|
5 |
+
Llama Materials set forth herein.
|
6 |
+
|
7 |
+
“Documentation” means the specifications, manuals and documentation accompanying Llama 3.1
|
8 |
+
distributed by Meta at https://llama.meta.com/doc/overview.
|
9 |
+
|
10 |
+
“Licensee” or “you” means you, or your employer or any other person or entity (if you are entering into
|
11 |
+
this Agreement on such person or entity’s behalf), of the age required under applicable laws, rules or
|
12 |
+
regulations to provide legal consent and that has legal authority to bind your employer or such other
|
13 |
+
person or entity if you are entering in this Agreement on their behalf.
|
14 |
+
|
15 |
+
“Llama 3.1” means the foundational large language models and software and algorithms, including
|
16 |
+
machine-learning model code, trained model weights, inference-enabling code, training-enabling code,
|
17 |
+
fine-tuning enabling code and other elements of the foregoing distributed by Meta at
|
18 |
+
https://llama.meta.com/llama-downloads.
|
19 |
+
|
20 |
+
“Llama Materials” means, collectively, Meta’s proprietary Llama 3.1 and Documentation (and any
|
21 |
+
portion thereof) made available under this Agreement.
|
22 |
+
|
23 |
+
“Meta” or “we” means Meta Platforms Ireland Limited (if you are located in or, if you are an entity, your
|
24 |
+
principal place of business is in the EEA or Switzerland) and Meta Platforms, Inc. (if you are located
|
25 |
+
outside of the EEA or Switzerland).
|
26 |
+
|
27 |
+
By clicking “I Accept” below or by using or distributing any portion or element of the Llama Materials,
|
28 |
+
you agree to be bound by this Agreement.
|
29 |
+
|
30 |
+
1. License Rights and Redistribution.
|
31 |
+
|
32 |
+
a. Grant of Rights. You are granted a non-exclusive, worldwide, non-transferable and royalty-free
|
33 |
+
limited license under Meta’s intellectual property or other rights owned by Meta embodied in the Llama
|
34 |
+
Materials to use, reproduce, distribute, copy, create derivative works of, and make modifications to the
|
35 |
+
Llama Materials.
|
36 |
+
|
37 |
+
b. Redistribution and Use.
|
38 |
+
|
39 |
+
i. If you distribute or make available the Llama Materials (or any derivative works
|
40 |
+
thereof), or a product or service (including another AI model) that contains any of them, you shall (A)
|
41 |
+
provide a copy of this Agreement with any such Llama Materials; and (B) prominently display “Built with
|
42 |
+
Llama” on a related website, user interface, blogpost, about page, or product documentation. If you use
|
43 |
+
the Llama Materials or any outputs or results of the Llama Materials to create, train, fine tune, or
|
44 |
+
otherwise improve an AI model, which is distributed or made available, you shall also include “Llama” at
|
45 |
+
the beginning of any such AI model name.
|
46 |
+
|
47 |
+
ii. If you receive Llama Materials, or any derivative works thereof, from a Licensee as part
|
48 |
+
of an integrated end user product, then Section 2 of this Agreement will not apply to you.
|
49 |
+
|
50 |
+
iii. You must retain in all copies of the Llama Materials that you distribute the following
|
51 |
+
attribution notice within a “Notice” text file distributed as a part of such copies: “Llama 3.1 is
|
52 |
+
licensed under the Llama 3.1 Community License, Copyright © Meta Platforms, Inc. All Rights
|
53 |
+
Reserved.”
|
54 |
+
|
55 |
+
iv. Your use of the Llama Materials must comply with applicable laws and regulations
|
56 |
+
(including trade compliance laws and regulations) and adhere to the Acceptable Use Policy for the Llama
|
57 |
+
Materials (available at https://llama.meta.com/llama3_1/use-policy), which is hereby incorporated by
|
58 |
+
reference into this Agreement.
|
59 |
+
|
60 |
+
2. Additional Commercial Terms. If, on the Llama 3.1 version release date, the monthly active users
|
61 |
+
of the products or services made available by or for Licensee, or Licensee’s affiliates, is greater than 700
|
62 |
+
million monthly active users in the preceding calendar month, you must request a license from Meta,
|
63 |
+
which Meta may grant to you in its sole discretion, and you are not authorized to exercise any of the
|
64 |
+
rights under this Agreement unless or until Meta otherwise expressly grants you such rights.
|
65 |
+
|
66 |
+
3. Disclaimer of Warranty. UNLESS REQUIRED BY APPLICABLE LAW, THE LLAMA MATERIALS AND ANY
|
67 |
+
OUTPUT AND RESULTS THEREFROM ARE PROVIDED ON AN “AS IS” BASIS, WITHOUT WARRANTIES OF
|
68 |
+
ANY KIND, AND META DISCLAIMS ALL WARRANTIES OF ANY KIND, BOTH EXPRESS AND IMPLIED,
|
69 |
+
INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OF TITLE, NON-INFRINGEMENT,
|
70 |
+
MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. YOU ARE SOLELY RESPONSIBLE FOR
|
71 |
+
DETERMINING THE APPROPRIATENESS OF USING OR REDISTRIBUTING THE LLAMA MATERIALS AND
|
72 |
+
ASSUME ANY RISKS ASSOCIATED WITH YOUR USE OF THE LLAMA MATERIALS AND ANY OUTPUT AND
|
73 |
+
RESULTS.
|
74 |
+
|
75 |
+
4. Limitation of Liability. IN NO EVENT WILL META OR ITS AFFILIATES BE LIABLE UNDER ANY THEORY OF
|
76 |
+
LIABILITY, WHETHER IN CONTRACT, TORT, NEGLIGENCE, PRODUCTS LIABILITY, OR OTHERWISE, ARISING
|
77 |
+
OUT OF THIS AGREEMENT, FOR ANY LOST PROFITS OR ANY INDIRECT, SPECIAL, CONSEQUENTIAL,
|
78 |
+
INCIDENTAL, EXEMPLARY OR PUNITIVE DAMAGES, EVEN IF META OR ITS AFFILIATES HAVE BEEN ADVISED
|
79 |
+
OF THE POSSIBILITY OF ANY OF THE FOREGOING.
|
80 |
+
|
81 |
+
5. Intellectual Property.
|
82 |
+
|
83 |
+
a. No trademark licenses are granted under this Agreement, and in connection with the Llama
|
84 |
+
Materials, neither Meta nor Licensee may use any name or mark owned by or associated with the other
|
85 |
+
or any of its affiliates, except as required for reasonable and customary use in describing and
|
86 |
+
redistributing the Llama Materials or as set forth in this Section 5(a). Meta hereby grants you a license to
|
87 |
+
use “Llama” (the “Mark”) solely as required to comply with the last sentence of Section 1.b.i. You will
|
88 |
+
comply with Meta’s brand guidelines (currently accessible at
|
89 |
+
https://about.meta.com/brand/resources/meta/company-brand/ ). All goodwill arising out of your use
|
90 |
+
of the Mark will inure to the benefit of Meta.
|
91 |
+
|
92 |
+
b. Subject to Meta’s ownership of Llama Materials and derivatives made by or for Meta, with
|
93 |
+
respect to any derivative works and modifications of the Llama Materials that are made by you, as
|
94 |
+
between you and Meta, you are and will be the owner of such derivative works and modifications.
|
95 |
+
|
96 |
+
c. If you institute litigation or other proceedings against Meta or any entity (including a
|
97 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Llama Materials or Llama 3.1 outputs or
|
98 |
+
results, or any portion of any of the foregoing, constitutes infringement of intellectual property or other
|
99 |
+
rights owned or licensable by you, then any licenses granted to you under this Agreement shall
|
100 |
+
terminate as of the date such litigation or claim is filed or instituted. You will indemnify and hold
|
101 |
+
harmless Meta from and against any claim by any third party arising out of or related to your use or
|
102 |
+
distribution of the Llama Materials.
|
103 |
+
|
104 |
+
6. Term and Termination. The term of this Agreement will commence upon your acceptance of this
|
105 |
+
Agreement or access to the Llama Materials and will continue in full force and effect until terminated in
|
106 |
+
accordance with the terms and conditions herein. Meta may terminate this Agreement if you are in
|
107 |
+
breach of any term or condition of this Agreement. Upon termination of this Agreement, you shall delete
|
108 |
+
and cease use of the Llama Materials. Sections 3, 4 and 7 shall survive the termination of this
|
109 |
+
Agreement.
|
110 |
+
|
111 |
+
7. Governing Law and Jurisdiction. This Agreement will be governed and construed under the laws of
|
112 |
+
the State of California without regard to choice of law principles, and the UN Convention on Contracts
|
113 |
+
for the International Sale of Goods does not apply to this Agreement. The courts of California shall have
|
114 |
+
exclusive jurisdiction of any dispute arising out of this Agreement.
|
README.md
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: llama3.1
|
3 |
+
language:
|
4 |
+
- en
|
5 |
+
- de
|
6 |
+
- fr
|
7 |
+
- it
|
8 |
+
- pt
|
9 |
+
- hi
|
10 |
+
- es
|
11 |
+
- th
|
12 |
+
library_name: transformers
|
13 |
+
pipeline_tag: text-generation
|
14 |
+
tags:
|
15 |
+
- llama-3.1
|
16 |
+
- meta
|
17 |
+
- bnb
|
18 |
+
---
|
19 |
+
|
20 |
+
> [!IMPORTANT]
|
21 |
+
> This repository is a community-driven quantized version of the original model [`meta-llama/Meta-Llama-3.1-405B`](https://huggingface.co/meta-llama/Meta-Llama-3.1-405B) which is the BF16 half-precision official version released by Meta AI.
|
22 |
+
|
23 |
+
## Model Information
|
24 |
+
|
25 |
+
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.
|
26 |
+
|
27 |
+
This repository contains [`meta-llama/Meta-Llama-3.1-405B`](https://huggingface.co/meta-llama/Meta-Llama-3.1-405B) quantized using [bitsandbytes](https://github.com/bitsandbytes-foundation/bitsandbytes) from BF16 down to NF4 with a block size of 64, **and storage type `torch.bfloat16`**.
|
28 |
+
|
29 |
+
## Model Usage
|
30 |
+
|
31 |
+
> [!NOTE]
|
32 |
+
> In order to run the inference with Llama 3.1 405B BNB in NF4, around 220 GiB of VRAM are needed only for loading the model checkpoint, without including the KV cache or the CUDA graphs, meaning that there should be a bit over that VRAM available.
|
33 |
+
|
34 |
+
In order to use the current quantized model, support is offered for different solutions as `transformers`, or `text-generation-inference`.
|
35 |
+
|
36 |
+
### 🤗 transformers
|
37 |
+
|
38 |
+
In order to run the inference with Llama 3.1 405B BNB in NF4, both `torch` and `bitsandbytes` need to be installed as:
|
39 |
+
|
40 |
+
```bash
|
41 |
+
pip install "torch>=2.0.0" bitsandbytes --upgrade
|
42 |
+
```
|
43 |
+
|
44 |
+
Then, the latest version of `transformers` need to be installed, being 4.43.0 or higher, as:
|
45 |
+
|
46 |
+
```bash
|
47 |
+
pip install "transformers[accelerate]>=4.43.0" --upgrade
|
48 |
+
```
|
49 |
+
|
50 |
+
To run the inference on top of Llama 3.1 405B BNB in NF4 precision, the model can be instantiated as any other causal language modeling model via `AutoModelForCausalLM` and run the inference normally.
|