RichardErkhov commited on
Commit
ef63545
·
verified ·
1 Parent(s): 2c95c48

uploaded readme

Browse files
Files changed (1) hide show
  1. README.md +275 -0
README.md ADDED
@@ -0,0 +1,275 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Quantization made by Richard Erkhov.
2
+
3
+ [Github](https://github.com/RichardErkhov)
4
+
5
+ [Discord](https://discord.gg/pvy7H8DZMG)
6
+
7
+ [Request more models](https://github.com/RichardErkhov/quant_request)
8
+
9
+
10
+ falcon-7b-sharded - GGUF
11
+ - Model creator: https://huggingface.co/vilsonrodrigues/
12
+ - Original model: https://huggingface.co/vilsonrodrigues/falcon-7b-sharded/
13
+
14
+
15
+ | Name | Quant method | Size |
16
+ | ---- | ---- | ---- |
17
+ | [falcon-7b-sharded.Q2_K.gguf](https://huggingface.co/RichardErkhov/vilsonrodrigues_-_falcon-7b-sharded-gguf/blob/main/falcon-7b-sharded.Q2_K.gguf) | Q2_K | 3.44GB |
18
+ | [falcon-7b-sharded.Q3_K_S.gguf](https://huggingface.co/RichardErkhov/vilsonrodrigues_-_falcon-7b-sharded-gguf/blob/main/falcon-7b-sharded.Q3_K_S.gguf) | Q3_K_S | 3.44GB |
19
+ | [falcon-7b-sharded.Q3_K.gguf](https://huggingface.co/RichardErkhov/vilsonrodrigues_-_falcon-7b-sharded-gguf/blob/main/falcon-7b-sharded.Q3_K.gguf) | Q3_K | 3.7GB |
20
+ | [falcon-7b-sharded.Q3_K_M.gguf](https://huggingface.co/RichardErkhov/vilsonrodrigues_-_falcon-7b-sharded-gguf/blob/main/falcon-7b-sharded.Q3_K_M.gguf) | Q3_K_M | 3.7GB |
21
+ | [falcon-7b-sharded.Q3_K_L.gguf](https://huggingface.co/RichardErkhov/vilsonrodrigues_-_falcon-7b-sharded-gguf/blob/main/falcon-7b-sharded.Q3_K_L.gguf) | Q3_K_L | 3.92GB |
22
+ | [falcon-7b-sharded.IQ4_XS.gguf](https://huggingface.co/RichardErkhov/vilsonrodrigues_-_falcon-7b-sharded-gguf/blob/main/falcon-7b-sharded.IQ4_XS.gguf) | IQ4_XS | 3.74GB |
23
+ | [falcon-7b-sharded.Q4_0.gguf](https://huggingface.co/RichardErkhov/vilsonrodrigues_-_falcon-7b-sharded-gguf/blob/main/falcon-7b-sharded.Q4_0.gguf) | Q4_0 | 3.77GB |
24
+ | [falcon-7b-sharded.IQ4_NL.gguf](https://huggingface.co/RichardErkhov/vilsonrodrigues_-_falcon-7b-sharded-gguf/blob/main/falcon-7b-sharded.IQ4_NL.gguf) | IQ4_NL | 3.81GB |
25
+ | [falcon-7b-sharded.Q4_K_S.gguf](https://huggingface.co/RichardErkhov/vilsonrodrigues_-_falcon-7b-sharded-gguf/blob/main/falcon-7b-sharded.Q4_K_S.gguf) | Q4_K_S | 4.23GB |
26
+ | [falcon-7b-sharded.Q4_K.gguf](https://huggingface.co/RichardErkhov/vilsonrodrigues_-_falcon-7b-sharded-gguf/blob/main/falcon-7b-sharded.Q4_K.gguf) | Q4_K | 4.44GB |
27
+ | [falcon-7b-sharded.Q4_K_M.gguf](https://huggingface.co/RichardErkhov/vilsonrodrigues_-_falcon-7b-sharded-gguf/blob/main/falcon-7b-sharded.Q4_K_M.gguf) | Q4_K_M | 4.44GB |
28
+ | [falcon-7b-sharded.Q4_1.gguf](https://huggingface.co/RichardErkhov/vilsonrodrigues_-_falcon-7b-sharded-gguf/blob/main/falcon-7b-sharded.Q4_1.gguf) | Q4_1 | 4.15GB |
29
+ | [falcon-7b-sharded.Q5_0.gguf](https://huggingface.co/RichardErkhov/vilsonrodrigues_-_falcon-7b-sharded-gguf/blob/main/falcon-7b-sharded.Q5_0.gguf) | Q5_0 | 4.54GB |
30
+ | [falcon-7b-sharded.Q5_K_S.gguf](https://huggingface.co/RichardErkhov/vilsonrodrigues_-_falcon-7b-sharded-gguf/blob/main/falcon-7b-sharded.Q5_K_S.gguf) | Q5_K_S | 4.77GB |
31
+ | [falcon-7b-sharded.Q5_K.gguf](https://huggingface.co/RichardErkhov/vilsonrodrigues_-_falcon-7b-sharded-gguf/blob/main/falcon-7b-sharded.Q5_K.gguf) | Q5_K | 5.13GB |
32
+ | [falcon-7b-sharded.Q5_K_M.gguf](https://huggingface.co/RichardErkhov/vilsonrodrigues_-_falcon-7b-sharded-gguf/blob/main/falcon-7b-sharded.Q5_K_M.gguf) | Q5_K_M | 5.13GB |
33
+ | [falcon-7b-sharded.Q5_1.gguf](https://huggingface.co/RichardErkhov/vilsonrodrigues_-_falcon-7b-sharded-gguf/blob/main/falcon-7b-sharded.Q5_1.gguf) | Q5_1 | 4.92GB |
34
+ | [falcon-7b-sharded.Q6_K.gguf](https://huggingface.co/RichardErkhov/vilsonrodrigues_-_falcon-7b-sharded-gguf/blob/main/falcon-7b-sharded.Q6_K.gguf) | Q6_K | 6.26GB |
35
+ | [falcon-7b-sharded.Q8_0.gguf](https://huggingface.co/RichardErkhov/vilsonrodrigues_-_falcon-7b-sharded-gguf/blob/main/falcon-7b-sharded.Q8_0.gguf) | Q8_0 | 6.85GB |
36
+
37
+
38
+
39
+
40
+ Original model description:
41
+ ---
42
+ datasets:
43
+ - tiiuae/falcon-refinedweb
44
+ language:
45
+ - en
46
+ inference: false
47
+ license: apache-2.0
48
+ ---
49
+
50
+ # Resharded
51
+
52
+ Resharded version of https://huggingface.co/tiiuae/falcon-7b for low RAM enviroments (e.g. Colab, Kaggle) in safetensors
53
+
54
+ # 🚀 Falcon-7B
55
+
56
+ **Falcon-7B is a 7B parameters causal decoder-only model built by [TII](https://www.tii.ae) and trained on 1,500B tokens of [RefinedWeb](https://huggingface.co/datasets/tiiuae/falcon-refinedweb) enhanced with curated corpora. It is made available under the Apache 2.0 license.**
57
+
58
+ *Paper coming soon* 😊.
59
+
60
+ 🤗 To get started with Falcon (inference, finetuning, quantization, etc.), we recommend reading [this great blogpost fron HF](https://huggingface.co/blog/falcon)!
61
+
62
+
63
+ ## Why use Falcon-7B?
64
+
65
+ * **It outperforms comparable open-source models** (e.g., [MPT-7B](https://huggingface.co/mosaicml/mpt-7b), [StableLM](https://github.com/Stability-AI/StableLM), [RedPajama](https://huggingface.co/togethercomputer/RedPajama-INCITE-Base-7B-v0.1) etc.), thanks to being trained on 1,500B tokens of [RefinedWeb](https://huggingface.co/datasets/tiiuae/falcon-refinedweb) enhanced with curated corpora. See the [OpenLLM Leaderboard](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard).
66
+ * **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)).
67
+ * **It is made available under a permissive Apache 2.0 license allowing for commercial use**, without any royalties or restrictions.
68
+
69
+ ⚠️ Falcon is now available as a core model in the `transformers` library! To use the in-library version, please install the latest version of `transformers` with `pip install git+https://github.com/ huggingface/transformers.git`, then simply remove the `trust_remote_code=True` argument from `from_pretrained()`.
70
+
71
+ ⚠️ **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-7B-Instruct](https://huggingface.co/tiiuae/falcon-7b-instruct).
72
+
73
+ 🔥 **Looking for an even more powerful model?** [Falcon-40B](https://huggingface.co/tiiuae/falcon-40b) is Falcon-7B's big brother!
74
+
75
+ ```python
76
+ from transformers import AutoTokenizer, AutoModelForCausalLM
77
+ import transformers
78
+ import torch
79
+ model = "tiiuae/falcon-7b"
80
+ tokenizer = AutoTokenizer.from_pretrained(model)
81
+ pipeline = transformers.pipeline(
82
+ "text-generation",
83
+ model=model,
84
+ tokenizer=tokenizer,
85
+ torch_dtype=torch.bfloat16,
86
+ device_map="auto",
87
+ )
88
+ sequences = pipeline(
89
+ "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:",
90
+ max_length=200,
91
+ do_sample=True,
92
+ top_k=10,
93
+ num_return_sequences=1,
94
+ eos_token_id=tokenizer.eos_token_id,
95
+ )
96
+ for seq in sequences:
97
+ print(f"Result: {seq['generated_text']}")
98
+ ```
99
+
100
+ 💥 **Falcon LLMs require PyTorch 2.0 for use with `transformers`!**
101
+
102
+ 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).
103
+
104
+ You will need **at least 16GB of memory** to swiftly run inference with Falcon-7B.
105
+
106
+ # Model Card for Falcon-7B
107
+
108
+ ## Model Details
109
+
110
+ ### Model Description
111
+
112
+ - **Developed by:** [https://www.tii.ae](https://www.tii.ae);
113
+ - **Model type:** Causal decoder-only;
114
+ - **Language(s) (NLP):** English and French;
115
+ - **License:** Apache 2.0.
116
+
117
+ ### Model Source
118
+
119
+ - **Paper:** *coming soon*.
120
+
121
+ ## Uses
122
+
123
+ ### Direct Use
124
+
125
+ Research on large language models; as a foundation for further specialization and finetuning for specific usecases (e.g., summarization, text generation, chatbot, etc.)
126
+
127
+ ### Out-of-Scope Use
128
+
129
+ Production use without adequate assessment of risks and mitigation; any use cases which may be considered irresponsible or harmful.
130
+
131
+ ## Bias, Risks, and Limitations
132
+
133
+ Falcon-7B is trained on English and French data only, and 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.
134
+
135
+ ### Recommendations
136
+
137
+ We recommend users of Falcon-7B 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.
138
+
139
+ ## How to Get Started with the Model
140
+
141
+
142
+ ```python
143
+ from transformers import AutoTokenizer, AutoModelForCausalLM
144
+ import transformers
145
+ import torch
146
+ model = "tiiuae/falcon-7b"
147
+ tokenizer = AutoTokenizer.from_pretrained(model)
148
+ pipeline = transformers.pipeline(
149
+ "text-generation",
150
+ model=model,
151
+ tokenizer=tokenizer,
152
+ torch_dtype=torch.bfloat16,
153
+ device_map="auto",
154
+ )
155
+ sequences = pipeline(
156
+ "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:",
157
+ max_length=200,
158
+ do_sample=True,
159
+ top_k=10,
160
+ num_return_sequences=1,
161
+ eos_token_id=tokenizer.eos_token_id,
162
+ )
163
+ for seq in sequences:
164
+ print(f"Result: {seq['generated_text']}")
165
+ ```
166
+
167
+ ## Training Details
168
+
169
+ ### Training Data
170
+
171
+ Falcon-7B was trained on 1,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)).
172
+
173
+ | **Data source** | **Fraction** | **Tokens** | **Sources** |
174
+ |--------------------|--------------|------------|-----------------------------------|
175
+ | [RefinedWeb-English](https://huggingface.co/datasets/tiiuae/falcon-refinedweb) | 79% | 1,185B | massive web crawl |
176
+ | Books | 7% | 110B | |
177
+ | Conversations | 6% | 85B | Reddit, StackOverflow, HackerNews |
178
+ | Code | 3% | 45B | |
179
+ | RefinedWeb-French | 3% | 45B | massive web crawl |
180
+ | Technical | 2% | 30B | arXiv, PubMed, USPTO, etc. |
181
+
182
+
183
+ The data was tokenized with the Falcon-[7B](https://huggingface.co/tiiuae/falcon-7b)/[40B](https://huggingface.co/tiiuae/falcon-40b) tokenizer.
184
+
185
+ ### Training Procedure
186
+
187
+ Falcon-7B was trained on 384 A100 40GB GPUs, using a 2D parallelism strategy (PP=2, DP=192) combined with ZeRO.
188
+
189
+ #### Training Hyperparameters
190
+
191
+ | **Hyperparameter** | **Value** | **Comment** |
192
+ |--------------------|------------|-------------------------------------------|
193
+ | Precision | `bfloat16` | |
194
+ | Optimizer | AdamW | |
195
+ | Learning rate | 6e-4 | 4B tokens warm-up, cosine decay to 1.2e-5 |
196
+ | Weight decay | 1e-1 | |
197
+ | Z-loss | 1e-4 | |
198
+ | Batch size | 2304 | 30B tokens ramp-up |
199
+
200
+
201
+ #### Speeds, Sizes, Times
202
+
203
+ Training happened in early March 2023 and took about two weeks.
204
+
205
+
206
+ ## Evaluation
207
+
208
+ *Paper coming soon*.
209
+
210
+ See the [OpenLLM Leaderboard](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard) for early results.
211
+
212
+
213
+ ## Technical Specifications
214
+
215
+ ### Model Architecture and Objective
216
+
217
+ Falcon-7B is a causal decoder-only model trained on a causal language modeling task (i.e., predict the next token).
218
+
219
+ The architecture is broadly adapted from the GPT-3 paper ([Brown et al., 2020](https://arxiv.org/abs/2005.14165)), with the following differences:
220
+
221
+ * **Positionnal embeddings:** rotary ([Su et al., 2021](https://arxiv.org/abs/2104.09864));
222
+ * **Attention:** multiquery ([Shazeer et al., 2019](https://arxiv.org/abs/1911.02150)) and FlashAttention ([Dao et al., 2022](https://arxiv.org/abs/2205.14135));
223
+ * **Decoder-block:** parallel attention/MLP with a single layer norm.
224
+
225
+ | **Hyperparameter** | **Value** | **Comment** |
226
+ |--------------------|-----------|----------------------------------------|
227
+ | Layers | 32 | |
228
+ | `d_model` | 4544 | Increased to compensate for multiquery |
229
+ | `head_dim` | 64 | Reduced to optimise for FlashAttention |
230
+ | Vocabulary | 65024 | |
231
+ | Sequence length | 2048 | |
232
+
233
+ ### Compute Infrastructure
234
+
235
+ #### Hardware
236
+
237
+ Falcon-7B was trained on AWS SageMaker, on 384 A100 40GB GPUs in P4d instances.
238
+
239
+ #### Software
240
+
241
+ Falcon-7B was trained a custom distributed training codebase, Gigatron. It uses a 3D parallelism approach combined with ZeRO and high-performance Triton kernels (FlashAttention, etc.)
242
+
243
+
244
+ ## Citation
245
+
246
+ *Paper coming soon* 😊. In the meanwhile, you can use the following information to cite:
247
+ ```
248
+ @article{falcon40b,
249
+ title={{Falcon-40B}: an open large language model with state-of-the-art performance},
250
+ 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},
251
+ year={2023}
252
+ }
253
+ ```
254
+
255
+ To learn more about the pretraining dataset, see the 📓 [RefinedWeb paper](https://arxiv.org/abs/2306.01116).
256
+
257
+ ```
258
+ @article{refinedweb,
259
+ title={The {R}efined{W}eb dataset for {F}alcon {LLM}: outperforming curated corpora with web data, and web data only},
260
+ 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},
261
+ journal={arXiv preprint arXiv:2306.01116},
262
+ eprint={2306.01116},
263
+ eprinttype = {arXiv},
264
+ url={https://arxiv.org/abs/2306.01116},
265
+ year={2023}
266
+ }
267
+ ```
268
+
269
+ ## License
270
+
271
+ Falcon-7B is made available under the Apache 2.0 license.
272
+
273
+ ## Contact
274
+ falconllm@tii.ae
275
+