TheBloke commited on
Commit
c930688
โ€ข
1 Parent(s): 7faa19b

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +474 -0
README.md ADDED
@@ -0,0 +1,474 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ datasets:
3
+ - tiiuae/falcon-refinedweb
4
+ inference: false
5
+ language:
6
+ - en
7
+ - de
8
+ - es
9
+ - fr
10
+ license: unknown
11
+ model_creator: Technology Innovation Institute
12
+ model_link: https://huggingface.co/tiiuae/falcon-180B
13
+ model_name: Falcon 180B
14
+ model_type: falcon
15
+ quantized_by: TheBloke
16
+ ---
17
+
18
+ <!-- header start -->
19
+ <!-- 200823 -->
20
+ <div style="width: auto; margin-left: auto; margin-right: auto">
21
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
22
+ </div>
23
+ <div style="display: flex; justify-content: space-between; width: 100%;">
24
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
25
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
26
+ </div>
27
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
28
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://www.patreon.com/TheBlokeAI">Want to contribute? TheBloke's Patreon page</a></p>
29
+ </div>
30
+ </div>
31
+ <div style="text-align:center; margin-top: 0em; margin-bottom: 0em"><p style="margin-top: 0.25em; margin-bottom: 0em;">TheBloke's LLM work is generously supported by a grant from <a href="https://a16z.com">andreessen horowitz (a16z)</a></p></div>
32
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
33
+ <!-- header end -->
34
+
35
+ # Falcon 180B - GGUF
36
+ - Model creator: [Technology Innovation Institute](https://huggingface.co/tiiuae)
37
+ - Original model: [Falcon 180B](https://huggingface.co/tiiuae/falcon-180B)
38
+
39
+ ## Description
40
+
41
+ This repo contains GGUF format model files for [Technology Innovation Institute's Falcon 180B](https://huggingface.co/tiiuae/falcon-180B).
42
+
43
+ <!-- README_GGUF.md-about-gguf start -->
44
+ ### About GGUF
45
+
46
+ GGUF is a new format introduced by the llama.cpp team on August 21st 2023. It is a replacement for GGML, which is no longer supported by llama.cpp.
47
+
48
+ The key benefit of GGUF is that it is a extensible, future-proof format which stores more information about the model as metadata. It also includes significantly improved tokenization code, including for the first time full support for special tokens. This should improve performance, especially with models that use new special tokens and implement custom prompt templates.
49
+
50
+ Here are a list of clients and libraries that are known to support GGUF:
51
+ * [llama.cpp](https://github.com/ggerganov/llama.cpp).
52
+ * [text-generation-webui](https://github.com/oobabooga/text-generation-webui), the most widely used web UI, with many features and powerful extensions.
53
+ * [KoboldCpp](https://github.com/LostRuins/koboldcpp), a fully featured web UI, with full GPU accel across multiple platforms and GPU architectures. Especially good for story telling.
54
+ * [LM Studio](https://lmstudio.ai/), an easy-to-use and powerful local GUI with GPU acceleration on both Windows (NVidia and AMD), and macOS.
55
+ * [LoLLMS Web UI](https://github.com/ParisNeo/lollms-webui), a great web UI with many interesting and unique features, including a full model library for easy model selection.
56
+ * [ctransformers](https://github.com/marella/ctransformers), a Python library with GPU accel, LangChain support, and OpenAI-compatible AI server.
57
+ * [llama-cpp-python](https://github.com/abetlen/llama-cpp-python), a Python library with GPU accel, LangChain support, and OpenAI-compatible API server.
58
+ * [candle](https://github.com/huggingface/candle), a Rust ML framework with a focus on performance, including GPU support, and ease of use.
59
+
60
+ <!-- README_GGUF.md-about-gguf end -->
61
+ <!-- repositories-available start -->
62
+ ## Repositories available
63
+
64
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/Falcon-180B-GGUF)
65
+ * [Technology Innovation Institute's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/tiiuae/falcon-180B)
66
+ <!-- repositories-available end -->
67
+
68
+ <!-- prompt-template start -->
69
+ ## Prompt template: None
70
+
71
+ ```
72
+ {prompt}
73
+
74
+ ```
75
+
76
+ <!-- prompt-template end -->
77
+ <!-- compatibility_gguf start -->
78
+ ## Compatibility
79
+
80
+ These quantised GGUF files are compatible with llama.cpp from August 21st 2023 onwards, as of commit [6381d4e110bd0ec02843a60bbeb8b6fc37a9ace9](https://github.com/ggerganov/llama.cpp/commit/6381d4e110bd0ec02843a60bbeb8b6fc37a9ace9)
81
+
82
+ They are now also compatible with many third party UIs and libraries - please see the list at the top of the README.
83
+
84
+ ## Explanation of quantisation methods
85
+ <details>
86
+ <summary>Click to see details</summary>
87
+
88
+ The new methods available are:
89
+ * GGML_TYPE_Q2_K - "type-1" 2-bit quantization in super-blocks containing 16 blocks, each block having 16 weight. Block scales and mins are quantized with 4 bits. This ends up effectively using 2.5625 bits per weight (bpw)
90
+ * GGML_TYPE_Q3_K - "type-0" 3-bit quantization in super-blocks containing 16 blocks, each block having 16 weights. Scales are quantized with 6 bits. This end up using 3.4375 bpw.
91
+ * GGML_TYPE_Q4_K - "type-1" 4-bit quantization in super-blocks containing 8 blocks, each block having 32 weights. Scales and mins are quantized with 6 bits. This ends up using 4.5 bpw.
92
+ * GGML_TYPE_Q5_K - "type-1" 5-bit quantization. Same super-block structure as GGML_TYPE_Q4_K resulting in 5.5 bpw
93
+ * GGML_TYPE_Q6_K - "type-0" 6-bit quantization. Super-blocks with 16 blocks, each block having 16 weights. Scales are quantized with 8 bits. This ends up using 6.5625 bpw
94
+
95
+ Refer to the Provided Files table below to see what files use which methods, and how.
96
+ </details>
97
+ <!-- compatibility_gguf end -->
98
+
99
+ <!-- README_GGUF.md-provided-files start -->
100
+ ## Provided files
101
+
102
+ | Name | Quant method | Bits | Size | Max RAM required | Use case |
103
+ | ---- | ---- | ---- | ---- | ---- | ----- |
104
+ | falcon-180b.Q2_K.gguf | Q2_K | 2 | 73.97 GB| 76.47 GB | smallest, significant quality loss - not recommended for most purposes |
105
+ | falcon-180b.Q3_K_S.gguf | Q3_K_S | 3 | 77.77 GB| 80.27 GB | very small, high quality loss |
106
+ | falcon-180b.Q3_K_M.gguf | Q3_K_M | 3 | 85.18 GB| 87.68 GB | very small, high quality loss |
107
+ | falcon-180b.Q3_K_L.gguf | Q3_K_L | 3 | 91.99 GB| 94.49 GB | small, substantial quality loss |
108
+ | falcon-180b.Q4_0.gguf | Q4_0 | 4 | 101.48 GB| 103.98 GB | legacy; small, very high quality loss - prefer using Q3_K_M |
109
+ | falcon-180b.Q4_K_S.gguf | Q4_K_S | 4 | 101.48 GB| 103.98 GB | small, greater quality loss |
110
+ | falcon-180b.Q4_K_M.gguf | Q4_K_M | 4 | 108.48 GB| 110.98 GB | medium, balanced quality - recommended |
111
+ | falcon-180b.Q5_0.gguf | Q5_0 | 5 | 123.80 GB| 126.30 GB | legacy; medium, balanced quality - prefer using Q4_K_M |
112
+ | falcon-180b.Q5_K_S.gguf | Q5_K_S | 5 | 123.80 GB| 126.30 GB | large, low quality loss - recommended |
113
+ | falcon-180b.Q5_K_M.gguf | Q5_K_M | 5 | 130.99 GB| 133.49 GB | large, very low quality loss - recommended |
114
+ | falcon-180b.Q6_K.gguf | Q6_K | 6 | 147.52 GB| 150.02 GB | very large, extremely low quality loss |
115
+ | falcon-180b.Q8_0.gguf | Q8_0 | 8 | 190.76 GB| 193.26 GB | very large, extremely low quality loss - not recommended |
116
+
117
+ **Note**: the above RAM figures assume no GPU offloading. If layers are offloaded to the GPU, this will reduce RAM usage and use VRAM instead.
118
+
119
+ ### Q6_K and Q8_0 files are split and require joining
120
+
121
+ **Note:** HF does not support uploading files larger than 50GB. Therefore I have uploaded the Q6_K and Q8_0 files as split files.
122
+
123
+ <details>
124
+ <summary>Click for instructions regarding Q6_K and Q8_0 files</summary>
125
+
126
+ ### q6_K
127
+ Please download:
128
+ * `falcon-180b.Q6_K.gguf-split-a`
129
+ * `falcon-180b.Q6_K.gguf-split-b`
130
+
131
+ ### q8_0
132
+ Please download:
133
+ * `falcon-180b.Q8_0.gguf-split-a`
134
+ * `falcon-180b.Q8_0.gguf-split-b`
135
+
136
+ To join the files, do the following:
137
+
138
+ Linux and macOS:
139
+ ```
140
+ cat falcon-180b.Q6_K.gguf-split-* > falcon-180b.Q6_K.gguf && rm falcon-180b.Q6_K.gguf-split-*
141
+ cat falcon-180b.Q8_0.gguf-split-* > falcon-180b.Q8_0.gguf && rm falcon-180b.Q8_0.gguf-split-*
142
+ ```
143
+ Windows command line:
144
+ ```
145
+ COPY /B falcon-180b.Q6_K.gguf-split-a + falcon-180b.Q6_K.gguf-split-b falcon-180b.Q6_K.gguf
146
+ del falcon-180b.Q6_K.gguf-split-a falcon-180b.Q6_K.gguf-split-b
147
+
148
+ COPY /B falcon-180b.Q8_0.gguf-split-a + falcon-180b.Q8_0.gguf-split-b falcon-180b.Q8_0.gguf
149
+ del falcon-180b.Q8_0.gguf-split-a falcon-180b.Q8_0.gguf-split-b
150
+ ```
151
+
152
+ </details>
153
+ <!-- README_GGUF.md-provided-files end -->
154
+
155
+ <!-- README_GGUF.md-how-to-run start -->
156
+ ## Example `llama.cpp` command
157
+
158
+ Make sure you are using `llama.cpp` from commit [6381d4e110bd0ec02843a60bbeb8b6fc37a9ace9](https://github.com/ggerganov/llama.cpp/commit/6381d4e110bd0ec02843a60bbeb8b6fc37a9ace9) or later.
159
+
160
+ For compatibility with older versions of llama.cpp, or for any third-party libraries or clients that haven't yet updated for GGUF, please use GGML files instead.
161
+
162
+ ```
163
+ ./main -t 10 -ngl 32 -m falcon-180b.q4_K_M.gguf --color -c 4096 --temp 0.7 --repeat_penalty 1.1 -n -1 -p "{prompt}"
164
+ ```
165
+ Change `-t 10` to the number of physical CPU cores you have. For example if your system has 8 cores/16 threads, use `-t 8`. If offloading all layers to GPU, set `-t 1`.
166
+
167
+ Change `-ngl 32` to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.
168
+
169
+ Change `-c 4096` to the desired sequence length for this model. For extended sequence models - eg 8K, 16K, 32K - the necessary RoPE scaling parameters are read from the GGUF file and set by llama.cpp automatically.
170
+
171
+ If you want to have a chat-style conversation, replace the `-p <PROMPT>` argument with `-i -ins`
172
+
173
+ For other parameters and how to use them, please refer to [the llama.cpp documentation](https://github.com/ggerganov/llama.cpp/blob/master/examples/main/README.md)
174
+
175
+ ## How to run in `text-generation-webui`
176
+
177
+ Further instructions here: [text-generation-webui/docs/llama.cpp.md](https://github.com/oobabooga/text-generation-webui/blob/main/docs/llama.cpp.md).
178
+
179
+ ## How to run from Python code
180
+
181
+ You can use GGUF models from Python using the [llama-cpp-python](https://github.com/abetlen/llama-cpp-python) or [ctransformers](https://github.com/marella/ctransformers) libraries.
182
+
183
+ ### How to load this model from Python using ctransformers
184
+
185
+ #### First install the package
186
+
187
+ ```bash
188
+ # Base ctransformers with no GPU acceleration
189
+ pip install ctransformers>=0.2.24
190
+ # Or with CUDA GPU acceleration
191
+ pip install ctransformers[cuda]>=0.2.24
192
+ # Or with ROCm GPU acceleration
193
+ CT_HIPBLAS=1 pip install ctransformers>=0.2.24 --no-binary ctransformers
194
+ # Or with Metal GPU acceleration for macOS systems
195
+ CT_METAL=1 pip install ctransformers>=0.2.24 --no-binary ctransformers
196
+ ```
197
+
198
+ #### Simple example code to load one of these GGUF models
199
+
200
+ ```python
201
+ from ctransformers import AutoModelForCausalLM
202
+
203
+ # Set gpu_layers to the number of layers to offload to GPU. Set to 0 if no GPU acceleration is available on your system.
204
+ llm = AutoModelForCausalLM.from_pretrained("TheBloke/Falcon-180B-GGUF", model_file="falcon-180b.q4_K_M.gguf", model_type="falcon", gpu_layers=50)
205
+
206
+ print(llm("AI is going to"))
207
+ ```
208
+
209
+ ## How to use with LangChain
210
+
211
+ Here's guides on using llama-cpp-python or ctransformers with LangChain:
212
+
213
+ * [LangChain + llama-cpp-python](https://python.langchain.com/docs/integrations/llms/llamacpp)
214
+ * [LangChain + ctransformers](https://python.langchain.com/docs/integrations/providers/ctransformers)
215
+
216
+ <!-- README_GGUF.md-how-to-run end -->
217
+
218
+ <!-- footer start -->
219
+ <!-- 200823 -->
220
+ ## Discord
221
+
222
+ For further support, and discussions on these models and AI in general, join us at:
223
+
224
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
225
+
226
+ ## Thanks, and how to contribute.
227
+
228
+ Thanks to the [chirper.ai](https://chirper.ai) team!
229
+
230
+ I've had a lot of people ask if they can contribute. I enjoy providing models and helping people, and would love to be able to spend even more time doing it, as well as expanding into new projects like fine tuning/training.
231
+
232
+ If you're able and willing to contribute it will be most gratefully received and will help me to keep providing more models, and to start work on new AI projects.
233
+
234
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
235
+
236
+ * Patreon: https://patreon.com/TheBlokeAI
237
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
238
+
239
+ **Special thanks to**: Aemon Algiz.
240
+
241
+ **Patreon special mentions**: Russ Johnson, J, alfie_i, Alex, NimbleBox.ai, Chadd, Mandus, Nikolai Manek, Ken Nordquist, ya boyyy, Illia Dulskyi, Viktor Bowallius, vamX, Iucharbius, zynix, Magnesian, Clay Pascal, Pierre Kircher, Enrico Ros, Tony Hughes, Elle, Andrey, knownsqashed, Deep Realms, Jerry Meng, Lone Striker, Derek Yates, Pyrater, Mesiah Bishop, James Bentley, Femi Adebogun, Brandon Frisco, SuperWojo, Alps Aficionado, Michael Dempsey, Vitor Caleffi, Will Dee, Edmond Seymore, usrbinkat, LangChain4j, Kacper Wikieล‚, Luke Pendergrass, John Detwiler, theTransient, Nathan LeClaire, Tiffany J. Kim, biorpg, Eugene Pentland, Stanislav Ovsiannikov, Fred von Graf, terasurfer, Kalila, Dan Guido, Nitin Borwankar, ้˜ฟๆ˜Ž, Ai Maven, John Villwock, Gabriel Puliatti, Stephen Murray, Asp the Wyvern, danny, Chris Smitley, ReadyPlayerEmma, S_X, Daniel P. Andersen, Olakabola, Jeffrey Morgan, Imad Khwaja, Caitlyn Gatomon, webtim, Alicia Loh, Trenton Dambrowitz, Swaroop Kallakuri, Erik Bjรคreholt, Leonard Tan, Spiking Neurons AB, Luke @flexchar, Ajan Kanaga, Thomas Belote, Deo Leter, RoA, Willem Michiel, transmissions 11, subjectnull, Matthew Berman, Joseph William Delisle, David Ziegler, Michael Davis, Johann-Peter Hartmann, Talal Aujan, senxiiz, Artur Olbinski, Rainer Wilmers, Spencer Kim, Fen Risland, Cap'n Zoog, Rishabh Srivastava, Michael Levine, Geoffrey Montalvo, Sean Connelly, Alexandros Triantafyllidis, Pieter, Gabriel Tamborski, Sam, Subspace Studios, Junyu Yang, Pedro Madruga, Vadim, Cory Kujawski, K, Raven Klaugh, Randy H, Mano Prime, Sebastain Graf, Space Cruiser
242
+
243
+
244
+ Thank you to all my generous patrons and donaters!
245
+
246
+ And thank you again to a16z for their generous grant.
247
+
248
+ <!-- footer end -->
249
+
250
+ <!-- original-model-card start -->
251
+ # Original model card: Technology Innovation Institute's Falcon 180B
252
+
253
+
254
+ # ๐Ÿš€ Falcon-180B
255
+
256
+ **Falcon-180B is a 180B parameters causal decoder-only model built by [TII](https://www.tii.ae) and trained on 3,500B tokens of [RefinedWeb](https://huggingface.co/datasets/tiiuae/falcon-refinedweb) enhanced with curated corpora. It is made available under the [Falcon-180B TII License](https://huggingface.co/spaces/tiiuae/falcon-180b-license/blob/main/LICENSE.txt) and [Acceptable Use Policy](https://huggingface.co/spaces/tiiuae/falcon-180b-license/blob/main/ACCEPTABLE_USE_POLICY.txt).**
257
+
258
+ *Paper coming soon* ๐Ÿ˜Š
259
+
260
+
261
+ ๐Ÿค— To get started with Falcon (inference, finetuning, quantization, etc.), we recommend reading [this great blogpost from HF](https://hf.co/blog/falcon-180b) or this [one](https://huggingface.co/blog/falcon) from the release of the 40B!
262
+ Note that since the 180B is larger than what can easily be handled with `transformers`+`acccelerate`, we recommend using [Text Generation Inference](https://github.com/huggingface/text-generation-inference).
263
+
264
+ You will need **at least 400GB of memory** to swiftly run inference with Falcon-180B.
265
+
266
+ ## Why use Falcon-180B?
267
+
268
+ * **It is the best open-access model currently available, and one of the best model overall.** Falcon-180B outperforms [LLaMA-2](https://huggingface.co/meta-llama/Llama-2-70b-hf), [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).
269
+ * **It features an architecture optimized for inference**, with multiquery ([Shazeer et al., 2019](https://arxiv.org/abs/1911.02150)).
270
+ * **It is made available under a permissive license allowing for commercial use**.
271
+ * โš ๏ธ **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-180B-Chat](https://huggingface.co/tiiuae/falcon-180b-chat).
272
+
273
+
274
+ ๐Ÿ’ธ **Looking for a smaller, less expensive model?** [Falcon-7B](https://huggingface.co/tiiuae/falcon-7b) and [Falcon-40B](https://huggingface.co/tiiuae/falcon-40b) are Falcon-180B's little brothers!
275
+
276
+ ๐Ÿ’ฅ **Falcon LLMs require PyTorch 2.0 for use with `transformers`!**
277
+
278
+
279
+ # Model Card for Falcon-180B
280
+
281
+ ## Model Details
282
+
283
+ ### Model Description
284
+
285
+ - **Developed by:** [https://www.tii.ae](https://www.tii.ae);
286
+ - **Model type:** Causal decoder-only;
287
+ - **Language(s) (NLP):** English, German, Spanish, French (and limited capabilities in Italian, Portuguese, Polish, Dutch, Romanian, Czech, Swedish);
288
+ - **License:** [Falcon-180B TII License](https://huggingface.co/tiiuae/falcon-180B/blob/main/LICENSE.txt) and [Acceptable Use Policy](https://huggingface.co/tiiuae/falcon-180B/blob/main/ACCEPTABLE_USE_POLICY.txt).
289
+
290
+ ### Model Source
291
+
292
+ - **Paper:** *coming soon*.
293
+
294
+ ## Uses
295
+
296
+ See the [acceptable use policy](https://huggingface.co/tiiuae/falcon-180B/blob/main/ACCEPTABLE_USE_POLICY.txt).
297
+
298
+ ### Direct Use
299
+
300
+ Research on large language models; as a foundation for further specialization and finetuning for specific usecases (e.g., summarization, text generation, chatbot, etc.)
301
+
302
+ ### Out-of-Scope Use
303
+
304
+ Production use without adequate assessment of risks and mitigation; any use cases which may be considered irresponsible or harmful.
305
+
306
+ ## Bias, Risks, and Limitations
307
+
308
+ Falcon-180B 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.
309
+
310
+ ### Recommendations
311
+
312
+ We recommend users of Falcon-180B 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.
313
+
314
+ ## How to Get Started with the Model
315
+
316
+ To run inference with the model in full `bfloat16` precision you need approximately 8xA100 80GB or equivalent.
317
+
318
+
319
+
320
+ ```python
321
+ from transformers import AutoTokenizer, AutoModelForCausalLM
322
+ import transformers
323
+ import torch
324
+
325
+ model = "tiiuae/falcon-180b"
326
+
327
+ tokenizer = AutoTokenizer.from_pretrained(model)
328
+ pipeline = transformers.pipeline(
329
+ "text-generation",
330
+ model=model,
331
+ tokenizer=tokenizer,
332
+ torch_dtype=torch.bfloat16,
333
+ trust_remote_code=True,
334
+ device_map="auto",
335
+ )
336
+ sequences = pipeline(
337
+ "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:",
338
+ max_length=200,
339
+ do_sample=True,
340
+ top_k=10,
341
+ num_return_sequences=1,
342
+ eos_token_id=tokenizer.eos_token_id,
343
+ )
344
+ for seq in sequences:
345
+ print(f"Result: {seq['generated_text']}")
346
+
347
+ ```
348
+
349
+ ## Training Details
350
+
351
+ ### Training Data
352
+
353
+ Falcon-180B was trained on 3,500B 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)).
354
+
355
+ | **Data source** | **Fraction** | **Tokens** | **Sources** |
356
+ |--------------------|--------------|------------|-----------------------------------|
357
+ | [RefinedWeb-English](https://huggingface.co/datasets/tiiuae/falcon-refinedweb) | 75% | 750B | massive web crawl |
358
+ | RefinedWeb-Europe | 7% | 70B | European massive web crawl |
359
+ | Books | 6% | 60B | |
360
+ | Conversations | 5% | 50B | Reddit, StackOverflow, HackerNews |
361
+ | Code | 5% | 50B | |
362
+ | Technical | 2% | 20B | arXiv, PubMed, USPTO, etc. |
363
+
364
+ RefinedWeb-Europe is made of the following languages:
365
+
366
+ | **Language** | **Fraction of multilingual data** | **Tokens** |
367
+ |--------------|-----------------------------------|------------|
368
+ | German | 26% | 18B |
369
+ | Spanish | 24% | 17B |
370
+ | French | 23% | 16B |
371
+ | _Italian_ | 7% | 5B |
372
+ | _Portuguese_ | 4% | 3B |
373
+ | _Polish_ | 4% | 3B |
374
+ | _Dutch_ | 4% | 3B |
375
+ | _Romanian_ | 3% | 2B |
376
+ | _Czech_ | 3% | 2B |
377
+ | _Swedish_ | 2% | 1B |
378
+
379
+
380
+ The data was tokenized with the Falcon tokenizer.
381
+
382
+ ### Training Procedure
383
+
384
+ Falcon-180B was trained on up to 4,096 A100 40GB GPUs, using a 3D parallelism strategy (TP=8, PP=8, DP=64) combined with ZeRO.
385
+
386
+ #### Training Hyperparameters
387
+
388
+ | **Hyperparameter** | **Value** | **Comment** |
389
+ |--------------------|------------|-------------------------------------------|
390
+ | Precision | `bfloat16` | |
391
+ | Optimizer | AdamW | |
392
+ | Learning rate | 1.25e-4 | 4B tokens warm-up, cosine decay to 1.25e-5 |
393
+ | Weight decay | 1e-1 | |
394
+ | Z-loss | 1e-4 | |
395
+ | Batch size | 2048 | 100B tokens ramp-up |
396
+
397
+
398
+ #### Speeds, Sizes, Times
399
+
400
+ Training started in early 2023.
401
+
402
+ ## Evaluation
403
+
404
+ *Paper coming soon.*
405
+
406
+ See the [OpenLLM Leaderboard](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard) for early results.
407
+
408
+
409
+ ## Technical Specifications
410
+
411
+ ### Model Architecture and Objective
412
+
413
+ Falcon-180B is a causal decoder-only model trained on a causal language modeling task (i.e., predict the next token).
414
+
415
+ The architecture is broadly adapted from the GPT-3 paper ([Brown et al., 2020](https://arxiv.org/abs/2005.14165)), with the following differences:
416
+
417
+ * **Positionnal embeddings:** rotary ([Su et al., 2021](https://arxiv.org/abs/2104.09864));
418
+ * **Attention:** multiquery ([Shazeer et al., 2019](https://arxiv.org/abs/1911.02150)) and FlashAttention ([Dao et al., 2022](https://arxiv.org/abs/2205.14135));
419
+ * **Decoder-block:** parallel attention/MLP with two layer norms.
420
+
421
+ For multiquery, we are using an internal variant which uses independent key and values per tensor parallel degree (so-called multigroup).
422
+
423
+ | **Hyperparameter** | **Value** | **Comment** |
424
+ |--------------------|-----------|----------------------------------------|
425
+ | Layers | 80 | |
426
+ | `d_model` | 14848 | |
427
+ | `head_dim` | 64 | Reduced to optimise for FlashAttention |
428
+ | Vocabulary | 65024 | |
429
+ | Sequence length | 2048 | |
430
+
431
+ ### Compute Infrastructure
432
+
433
+ #### Hardware
434
+
435
+ Falcon-180B was trained on AWS SageMaker, on up to 4,096 A100 40GB GPUs in P4d instances.
436
+
437
+ #### Software
438
+
439
+ Falcon-180B was trained a custom distributed training codebase, Gigatron. It uses a 3D parallelism approach combined with ZeRO and high-performance Triton kernels (FlashAttention, etc.)
440
+
441
+
442
+ ## Citation
443
+
444
+ *Paper coming soon* ๐Ÿ˜Š (actually this time). In the meanwhile, you can use the following information to cite:
445
+ ```
446
+ @article{falcon,
447
+ title={The Falcon Series of Language Models: Towards Open Frontier Models},
448
+ author={Almazrouei, Ebtesam and Alobeidli, Hamza and Alshamsi, Abdulaziz and Cappelli, Alessandro and Cojocaru, Ruxandra and Alhammadi, Maitha and Daniele, Mazzotta and Heslow, Daniel and Launay, Julien and Malartic, Quentin and Noune, Badreddine and Pannier, Baptiste and Penedo, Guilherme},
449
+ year={2023}
450
+ }
451
+ ```
452
+
453
+
454
+
455
+
456
+ To learn more about the pretraining dataset, see the ๐Ÿ““ [RefinedWeb paper](https://arxiv.org/abs/2306.01116).
457
+
458
+ ```
459
+ @article{refinedweb,
460
+ title={The {R}efined{W}eb dataset for {F}alcon {LLM}: outperforming curated corpora with web data, and web data only},
461
+ 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},
462
+ journal={arXiv preprint arXiv:2306.01116},
463
+ eprint={2306.01116},
464
+ eprinttype = {arXiv},
465
+ url={https://arxiv.org/abs/2306.01116},
466
+ year={2023}
467
+ }
468
+ ```
469
+
470
+
471
+ ## Contact
472
473
+
474
+ <!-- original-model-card end -->