GGUF
maddes8cht commited on
Commit
7d4540a
·
1 Parent(s): 959296b

"Update README.md"

Browse files
Files changed (1) hide show
  1. README.md +285 -5
README.md CHANGED
@@ -9,11 +9,291 @@ language:
9
  inference: false
10
  license: apache-2.0
11
  ---
12
- ![banner](https://maddes8cht.github.io/assets/buttons/Huggingface-banner.jpg)
 
13
  ## I am still building the structure of these descriptions.
14
- These will carry increasingly more content to help find the best models for a purpose.
15
- Tiiuae-Falcon 7B is the original foundational Falcon model from Tiiuae, converted to gguf format.
16
 
17
- This is a gguf quantized version of
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
 
19
- https://huggingface.co/tiiuae/falcon-40b
 
 
 
 
 
 
 
9
  inference: false
10
  license: apache-2.0
11
  ---
12
+ [![banner](https://maddes8cht.github.io/assets/buttons/Huggingface-banner.jpg)]()
13
+
14
  ## I am still building the structure of these descriptions.
 
 
15
 
16
+ These will contain increasingly more content to help find the best models for a purpose.
17
+
18
+ # falcon-40b - GGUF
19
+ - Model creator: [tiiuae](https://huggingface.co/tiiuae)
20
+ - Original model: [falcon-40b](https://huggingface.co/tiiuae/falcon-40b)
21
+ These are gguf quantized models of the riginal Falcon 40B Model by tiiuae.
22
+ Falcon is a foundational large language model coming in two different sizes: 7b and 40b.
23
+ # About GGUF format
24
+
25
+ `gguf` is the current file format used by the [`ggml`](https://github.com/ggerganov/ggml) library.
26
+ A growing list of Software is using it and can therefore use this model.
27
+ The core project making use of the ggml library is the [llama.cpp](https://github.com/ggerganov/llama.cpp) project by Georgi Gerganov
28
+
29
+ # Quantization variants
30
+
31
+ There is a bunch of quantized files available. How to choose the best for you:
32
+
33
+ # legacy quants
34
+
35
+ Q4_0, Q4_1, Q5_0, Q5_1 and Q8 are `legacy` quantization types.
36
+ Nevertheless, they are fully supported, as there are several circumstances that cause certain model not to be compatible with the modern K-quants.
37
+ Falcon 7B models cannot be quantized to K-quants.
38
+
39
+ # K-quants
40
+
41
+ K-quants are based on the idea that the quantization of certain parts affects the quality in different ways. If you quantize certain parts more and others less, you get a more powerful model with the same file size, or a smaller file size and lower memory load with comparable performance.
42
+ So, if possible, use K-quants.
43
+ With a Q6_K you should find it really hard to find a quality difference to the original model - ask your model two times the same question and you may encounter bigger quality differences.
44
+
45
+
46
+ # Original Model Card:
47
+ # 🚀 Falcon-40B
48
+
49
+ **Falcon-40B is a 40B parameters causal decoder-only model built by [TII](https://www.tii.ae) and trained on 1,000B tokens of [RefinedWeb](https://huggingface.co/datasets/tiiuae/falcon-refinedweb) enhanced with curated corpora. It is made available under the Apache 2.0 license.**
50
+
51
+ *Paper coming soon 😊.*
52
+
53
+
54
+ 🤗 To get started with Falcon (inference, finetuning, quantization, etc.), we recommend reading [this great blogpost fron HF](https://huggingface.co/blog/falcon)!
55
+
56
+ ## Why use Falcon-40B?
57
+
58
+ * **It is the best open-source model currently available.** Falcon-40B outperforms [LLaMA](https://github.com/facebookresearch/llama), [StableLM](https://github.com/Stability-AI/StableLM), [RedPajama](https://huggingface.co/togethercomputer/RedPajama-INCITE-Base-7B-v0.1), [MPT](https://huggingface.co/mosaicml/mpt-7b), etc. See the [OpenLLM Leaderboard](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard).
59
+ * **It features an architecture optimized for inference**, with FlashAttention ([Dao et al., 2022](https://arxiv.org/abs/2205.14135)) and multiquery ([Shazeer et al., 2019](https://arxiv.org/abs/1911.02150)).
60
+ * **It is made available under a permissive Apache 2.0 license allowing for commercial use**, without any royalties or restrictions.
61
+ *
62
+ ⚠️ **This is a raw, pretrained model, which should be further finetuned for most usecases.** If you are looking for a version better suited to taking generic instructions in a chat format, we recommend taking a look at [Falcon-40B-Instruct](https://huggingface.co/tiiuae/falcon-40b-instruct).
63
+
64
+ 💸 **Looking for a smaller, less expensive model?** [Falcon-7B](https://huggingface.co/tiiuae/falcon-7b) is Falcon-40B's little brother!
65
+
66
+ ```python
67
+ from transformers import AutoTokenizer, AutoModelForCausalLM
68
+ import transformers
69
+ import torch
70
+
71
+ model = "tiiuae/falcon-40b"
72
+
73
+ tokenizer = AutoTokenizer.from_pretrained(model)
74
+ pipeline = transformers.pipeline(
75
+ "text-generation",
76
+ model=model,
77
+ tokenizer=tokenizer,
78
+ torch_dtype=torch.bfloat16,
79
+ trust_remote_code=True,
80
+ device_map="auto",
81
+ )
82
+ sequences = pipeline(
83
+ "Girafatron is obsessed with giraffes, the most glorious animal on the face of this Earth. Giraftron believes all other animals are irrelevant when compared to the glorious majesty of the giraffe.\nDaniel: Hello, Girafatron!\nGirafatron:",
84
+ max_length=200,
85
+ do_sample=True,
86
+ top_k=10,
87
+ num_return_sequences=1,
88
+ eos_token_id=tokenizer.eos_token_id,
89
+ )
90
+ for seq in sequences:
91
+ print(f"Result: {seq['generated_text']}")
92
+
93
+ ```
94
+
95
+ 💥 **Falcon LLMs require PyTorch 2.0 for use with `transformers`!**
96
+
97
+ For fast inference with Falcon, check-out [Text Generation Inference](https://github.com/huggingface/text-generation-inference)! Read more in this [blogpost]((https://huggingface.co/blog/falcon).
98
+
99
+ You will need **at least 85-100GB of memory** to swiftly run inference with Falcon-40B.
100
+
101
+ # Model Card for Falcon-40B
102
+
103
+ ## Model Details
104
+
105
+ ### Model Description
106
+
107
+ - **Developed by:** [https://www.tii.ae](https://www.tii.ae);
108
+ - **Model type:** Causal decoder-only;
109
+ - **Language(s) (NLP):** English, German, Spanish, French (and limited capabilities in Italian, Portuguese, Polish, Dutch, Romanian, Czech, Swedish);
110
+ - **License:** Apache 2.0 license.
111
+
112
+ ### Model Source
113
+
114
+ - **Paper:** *coming soon*.
115
+
116
+ ## Uses
117
+
118
+ ### Direct Use
119
+
120
+ Research on large language models; as a foundation for further specialization and finetuning for specific usecases (e.g., summarization, text generation, chatbot, etc.)
121
+
122
+ ### Out-of-Scope Use
123
+
124
+ Production use without adequate assessment of risks and mitigation; any use cases which may be considered irresponsible or harmful.
125
+
126
+ ## Bias, Risks, and Limitations
127
+
128
+ Falcon-40B is trained mostly on English, German, Spanish, French, with limited capabilities also in in Italian, Portuguese, Polish, Dutch, Romanian, Czech, Swedish. It will not generalize appropriately to other languages. Furthermore, as it is trained on a large-scale corpora representative of the web, it will carry the stereotypes and biases commonly encountered online.
129
+
130
+ ### Recommendations
131
+
132
+ We recommend users of Falcon-40B to consider finetuning it for the specific set of tasks of interest, and for guardrails and appropriate precautions to be taken for any production use.
133
+
134
+ ## How to Get Started with the Model
135
+
136
+
137
+ ```python
138
+ from transformers import AutoTokenizer, AutoModelForCausalLM
139
+ import transformers
140
+ import torch
141
+
142
+ model = "tiiuae/falcon-40b"
143
+
144
+ tokenizer = AutoTokenizer.from_pretrained(model)
145
+ pipeline = transformers.pipeline(
146
+ "text-generation",
147
+ model=model,
148
+ tokenizer=tokenizer,
149
+ torch_dtype=torch.bfloat16,
150
+ trust_remote_code=True,
151
+ device_map="auto",
152
+ )
153
+ sequences = pipeline(
154
+ "Girafatron is obsessed with giraffes, the most glorious animal on the face of this Earth. Giraftron believes all other animals are irrelevant when compared to the glorious majesty of the giraffe.\nDaniel: Hello, Girafatron!\nGirafatron:",
155
+ max_length=200,
156
+ do_sample=True,
157
+ top_k=10,
158
+ num_return_sequences=1,
159
+ eos_token_id=tokenizer.eos_token_id,
160
+ )
161
+ for seq in sequences:
162
+ print(f"Result: {seq['generated_text']}")
163
+
164
+ ```
165
+
166
+ ## Training Details
167
+
168
+ ### Training Data
169
+
170
+ Falcon-40B was trained on 1,000B tokens of [RefinedWeb](https://huggingface.co/datasets/tiiuae/falcon-refinedweb), a high-quality filtered and deduplicated web dataset which we enhanced with curated corpora. Significant components from our curated copora were inspired by The Pile ([Gao et al., 2020](https://arxiv.org/abs/2101.00027)).
171
+
172
+ | **Data source** | **Fraction** | **Tokens** | **Sources** |
173
+ |--------------------|--------------|------------|-----------------------------------|
174
+ | [RefinedWeb-English](https://huggingface.co/datasets/tiiuae/falcon-refinedweb) | 75% | 750B | massive web crawl |
175
+ | RefinedWeb-Europe | 7% | 70B | European massive web crawl |
176
+ | Books | 6% | 60B | |
177
+ | Conversations | 5% | 50B | Reddit, StackOverflow, HackerNews |
178
+ | Code | 5% | 50B | |
179
+ | Technical | 2% | 20B | arXiv, PubMed, USPTO, etc. |
180
+
181
+ RefinedWeb-Europe is made of the following languages:
182
+
183
+ | **Language** | **Fraction of multilingual data** | **Tokens** |
184
+ |--------------|-----------------------------------|------------|
185
+ | German | 26% | 18B |
186
+ | Spanish | 24% | 17B |
187
+ | French | 23% | 16B |
188
+ | _Italian_ | 7% | 5B |
189
+ | _Portuguese_ | 4% | 3B |
190
+ | _Polish_ | 4% | 3B |
191
+ | _Dutch_ | 4% | 3B |
192
+ | _Romanian_ | 3% | 2B |
193
+ | _Czech_ | 3% | 2B |
194
+ | _Swedish_ | 2% | 1B |
195
+
196
+
197
+ The data was tokenized with the Falcon-[7B](https://huggingface.co/tiiuae/falcon-7b)/[40B](https://huggingface.co/tiiuae/falcon-40b) tokenizer.
198
+
199
+ ### Training Procedure
200
+
201
+ Falcon-40B was trained on 384 A100 40GB GPUs, using a 3D parallelism strategy (TP=8, PP=4, DP=12) combined with ZeRO.
202
+
203
+ #### Training Hyperparameters
204
+
205
+ | **Hyperparameter** | **Value** | **Comment** |
206
+ |--------------------|------------|-------------------------------------------|
207
+ | Precision | `bfloat16` | |
208
+ | Optimizer | AdamW | |
209
+ | Learning rate | 1.85e-4 | 4B tokens warm-up, cosine decay to 1.85e-5 |
210
+ | Weight decay | 1e-1 | |
211
+ | Z-loss | 1e-4 | |
212
+ | Batch size | 1152 | 100B tokens ramp-up |
213
+
214
+
215
+ #### Speeds, Sizes, Times
216
+
217
+ Training started in December 2022 and took two months.
218
+
219
+
220
+ ## Evaluation
221
+
222
+ *Paper coming soon.*
223
+
224
+ See the [OpenLLM Leaderboard](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard) for early results.
225
+
226
+
227
+ ## Technical Specifications
228
+
229
+ ### Model Architecture and Objective
230
+
231
+ Falcon-40B is a causal decoder-only model trained on a causal language modeling task (i.e., predict the next token).
232
+
233
+ The architecture is broadly adapted from the GPT-3 paper ([Brown et al., 2020](https://arxiv.org/abs/2005.14165)), with the following differences:
234
+
235
+ * **Positionnal embeddings:** rotary ([Su et al., 2021](https://arxiv.org/abs/2104.09864));
236
+ * **Attention:** multiquery ([Shazeer et al., 2019](https://arxiv.org/abs/1911.02150)) and FlashAttention ([Dao et al., 2022](https://arxiv.org/abs/2205.14135));
237
+ * **Decoder-block:** parallel attention/MLP with a two layer norms.
238
+
239
+ For multiquery, we are using an internal variant which uses independent key and values per tensor parallel degree.
240
+
241
+ | **Hyperparameter** | **Value** | **Comment** |
242
+ |--------------------|-----------|----------------------------------------|
243
+ | Layers | 60 | |
244
+ | `d_model` | 8192 | |
245
+ | `head_dim` | 64 | Reduced to optimise for FlashAttention |
246
+ | Vocabulary | 65024 | |
247
+ | Sequence length | 2048 | |
248
+
249
+ ### Compute Infrastructure
250
+
251
+ #### Hardware
252
+
253
+ Falcon-40B was trained on AWS SageMaker, on 384 A100 40GB GPUs in P4d instances.
254
+
255
+ #### Software
256
+
257
+ Falcon-40B was trained a custom distributed training codebase, Gigatron. It uses a 3D parallelism approach combined with ZeRO and high-performance Triton kernels (FlashAttention, etc.)
258
+
259
+
260
+ ## Citation
261
+
262
+ *Paper coming soon* 😊. In the meanwhile, you can use the following information to cite:
263
+ ```
264
+ @article{falcon40b,
265
+ title={{Falcon-40B}: an open large language model with state-of-the-art performance},
266
+ author={Almazrouei, Ebtesam and Alobeidli, Hamza and Alshamsi, Abdulaziz and Cappelli, Alessandro and Cojocaru, Ruxandra and Debbah, Merouane and Goffinet, Etienne and Heslow, Daniel and Launay, Julien and Malartic, Quentin and Noune, Badreddine and Pannier, Baptiste and Penedo, Guilherme},
267
+ year={2023}
268
+ }
269
+ ```
270
+
271
+ To learn more about the pretraining dataset, see the 📓 [RefinedWeb paper](https://arxiv.org/abs/2306.01116).
272
+
273
+ ```
274
+ @article{refinedweb,
275
+ title={The {R}efined{W}eb dataset for {F}alcon {LLM}: outperforming curated corpora with web data, and web data only},
276
+ author={Guilherme Penedo and Quentin Malartic and Daniel Hesslow and Ruxandra Cojocaru and Alessandro Cappelli and Hamza Alobeidli and Baptiste Pannier and Ebtesam Almazrouei and Julien Launay},
277
+ journal={arXiv preprint arXiv:2306.01116},
278
+ eprint={2306.01116},
279
+ eprinttype = {arXiv},
280
+ url={https://arxiv.org/abs/2306.01116},
281
+ year={2023}
282
+ }
283
+ ```
284
+
285
+
286
+ ## License
287
+
288
+ Falcon-40B is made available under the Apache 2.0 license.
289
+
290
+ ## Contact
291
292
 
293
+ <center>
294
+ <a href="https://maddes8cht.github.com"><img src="/assets/buttons/maddes8cht-github-io.jpg" alt="GitHub" /></a>
295
+ <a href="https://stackexchange.com/users/26485911"><img src="https://stackexchange.com/users/flair/26485911.png" width="208" height="58" alt="profile for maddes8cht on Stack Exchange, a network of free, community-driven Q&amp;A sites" title="profile for maddes8cht on Stack Exchange, a network of free, community-driven Q&amp;A sites"></a>
296
+ <a href="https://github.com/maddes8cht"><img src="/assets/buttons/github-button.jpg" alt="GitHub" /></a>
297
+ <a href="https://huggingface.co/maddes8cht"><img src="/assets/buttons/huggingface-button.jpg" alt="HuggingFace" /></a></p>
298
+ <a href="https://twitter.com/maddes1966"><img src="/assets/buttons/twitter-button.jpg" alt="HuggingFace" /></a></p>
299
+ </center>