TheBloke commited on
Commit
914a31a
•
1 Parent(s): c766d42

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +192 -3
README.md CHANGED
@@ -124,13 +124,13 @@ print(tokenizer.decode(output[0]))
124
 
125
  ## Provided files
126
 
127
- **gptq_model-4bit-64g.safetensors**
128
 
129
  This will work with AutoGPTQ as of commit `3cb1bf5` (`3cb1bf5a6d43a06dc34c6442287965d1838303d3`)
130
 
131
- It was created with groupsize 64 to give higher inference quality, and without `desc_act` (act-order) to increase inference speed.
132
 
133
- * `gptq_model-4bit-64g.safetensors`
134
  * Works only with latest AutoGPTQ CUDA, compiled from source as of commit `3cb1bf5`
135
  * At this time it does not work with AutoGPTQ Triton, but support will hopefully be added in time.
136
  * Works with text-generation-webui using `--autogptq --trust_remote_code`
@@ -138,4 +138,193 @@ It was created with groupsize 64 to give higher inference quality, and without `
138
  * Does not work with any version of GPTQ-for-LLaMa
139
  * Parameters: Groupsize = 64. No act-order.
140
 
 
 
 
 
 
 
 
 
 
141
  # ✨ Original model card: Falcon-40B-Instruct
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
124
 
125
  ## Provided files
126
 
127
+ **gptq_model-4bit.safetensors**
128
 
129
  This will work with AutoGPTQ as of commit `3cb1bf5` (`3cb1bf5a6d43a06dc34c6442287965d1838303d3`)
130
 
131
+ It was created with no groupsize to reduce VRAM requirements as much as possible, with `desc_act` (act-order) to increase inference quality.
132
 
133
+ * `gptq_model-4bit.safetensors`
134
  * Works only with latest AutoGPTQ CUDA, compiled from source as of commit `3cb1bf5`
135
  * At this time it does not work with AutoGPTQ Triton, but support will hopefully be added in time.
136
  * Works with text-generation-webui using `--autogptq --trust_remote_code`
 
138
  * Does not work with any version of GPTQ-for-LLaMa
139
  * Parameters: Groupsize = 64. No act-order.
140
 
141
+ ## Want to support my work?
142
+
143
+ I've had a lot of people ask if they can contribute. I love providing models and helping people, but it is starting to rack up pretty big cloud computing bills.
144
+
145
+ So if you're able and willing to contribute, it'd be most gratefully received and will help me to keep providing models, and work on various AI proejcts.
146
+
147
+ * Patreon: coming soon! (just awaiting approval)
148
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
149
+
150
  # ✨ Original model card: Falcon-40B-Instruct
151
+
152
+ # ✨ Falcon-40B-Instruct
153
+
154
+ **Falcon-40B-Instruct is a 40B parameters causal decoder-only model built by [TII](https://www.tii.ae) based on [Falcon-40B](https://huggingface.co/tiiuae/falcon-40b) and finetuned on a mixture of [Baize](https://github.com/project-baize/baize-chatbot). It is made available under the [TII Falcon LLM License](https://huggingface.co/tiiuae/falcon-40b-instruct/blob/main/LICENSE.txt).**
155
+
156
+ *Paper coming soon 😊.*
157
+
158
+ ## Why use Falcon-40B-Instruct?
159
+
160
+ * **You are looking for a ready-to-use chat/instruct model based on [Falcon-40B](https://huggingface.co/tiiuae/falcon-40b).**
161
+ * **Falcon-40B is the best open-source model available.** It 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).
162
+ * **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)).
163
+
164
+ 💬 **This is an instruct model, which may not be ideal for further finetuning.** If you are interested in building your own instruct/chat model, we recommend starting from [Falcon-40B](https://huggingface.co/tiiuae/falcon-40b).
165
+
166
+ 💸 **Looking for a smaller, less expensive model?** [Falcon-7B-Instruct](https://huggingface.co/tiiuae/falcon-7b-instruct) is Falcon-40B-Instruct's small brother!
167
+
168
+ ```python
169
+ from transformers import AutoTokenizer, AutoModelForCausalLM
170
+ import transformers
171
+ import torch
172
+
173
+ model = "tiiuae/falcon-40b-instruct"
174
+
175
+ tokenizer = AutoTokenizer.from_pretrained(model)
176
+ pipeline = transformers.pipeline(
177
+ "text-generation",
178
+ model=model,
179
+ tokenizer=tokenizer,
180
+ torch_dtype=torch.bfloat16,
181
+ trust_remote_code=True,
182
+ device_map="auto",
183
+ )
184
+ sequences = pipeline(
185
+ "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:",
186
+ max_length=200,
187
+ do_sample=True,
188
+ top_k=10,
189
+ num_return_sequences=1,
190
+ eos_token_id=tokenizer.eos_token_id,
191
+ )
192
+ for seq in sequences:
193
+ print(f"Result: {seq['generated_text']}")
194
+
195
+ ```
196
+
197
+
198
+
199
+ # Model Card for Falcon-40B-Instruct
200
+
201
+ ## Model Details
202
+
203
+ ### Model Description
204
+
205
+ - **Developed by:** [https://www.tii.ae](https://www.tii.ae);
206
+ - **Model type:** Causal decoder-only;
207
+ - **Language(s) (NLP):** English and French;
208
+ - **License:** [TII Falcon LLM License](https://huggingface.co/tiiuae/falcon-7b-instruct/blob/main/LICENSE.txt);
209
+ - **Finetuned from model:** [Falcon-7B](https://huggingface.co/tiiuae/falcon-7b).
210
+
211
+ ### Model Source
212
+
213
+ - **Paper:** *coming soon*.
214
+
215
+ ## Uses
216
+
217
+ ### Direct Use
218
+
219
+ Falcon-40B-Instruct has been finetuned on a chat dataset.
220
+
221
+ ### Out-of-Scope Use
222
+
223
+ Production use without adequate assessment of risks and mitigation; any use cases which may be considered irresponsible or harmful.
224
+
225
+ ## Bias, Risks, and Limitations
226
+
227
+ Falcon-40B-Instruct is mostly trained on English data, 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.
228
+
229
+ ### Recommendations
230
+
231
+ We recommend users of Falcon-40B-Instruct to develop guardrails and to take appropriate precautions for any production use.
232
+
233
+ ## How to Get Started with the Model
234
+
235
+
236
+ ```python
237
+ from transformers import AutoTokenizer, AutoModelForCausalLM
238
+ import transformers
239
+ import torch
240
+
241
+ model = "tiiuae/falcon-40b-instruct"
242
+
243
+ tokenizer = AutoTokenizer.from_pretrained(model)
244
+ pipeline = transformers.pipeline(
245
+ "text-generation",
246
+ model=model,
247
+ tokenizer=tokenizer,
248
+ torch_dtype=torch.bfloat16,
249
+ trust_remote_code=True,
250
+ device_map="auto",
251
+ )
252
+ sequences = pipeline(
253
+ "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:",
254
+ max_length=200,
255
+ do_sample=True,
256
+ top_k=10,
257
+ num_return_sequences=1,
258
+ eos_token_id=tokenizer.eos_token_id,
259
+ )
260
+ for seq in sequences:
261
+ print(f"Result: {seq['generated_text']}")
262
+
263
+ ```
264
+
265
+ ## Training Details
266
+
267
+ ### Training Data
268
+
269
+ Falcon-40B-Instruct was finetuned on a 150M tokens from [Bai ze](https://github.com/project-baize/baize-chatbot) mixed with 5% of [RefinedWeb](https://huggingface.co/datasets/tiiuae/falcon-refinedweb) data.
270
+
271
+
272
+ The data was tokenized with the Falcon-[7B](https://huggingface.co/tiiuae/falcon-7b)/[40B](https://huggingface.co/tiiuae/falcon-40b) tokenizer.
273
+
274
+
275
+ ## Evaluation
276
+
277
+ *Paper coming soon.*
278
+
279
+ See the [OpenLLM Leaderboard](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard) for early results.
280
+
281
+
282
+ ## Technical Specifications
283
+
284
+ For more information about pretraining, see [Falcon-40B](https://huggingface.co/tiiuae/falcon-40b).
285
+
286
+ ### Model Architecture and Objective
287
+
288
+ Falcon-40B is a causal decoder-only model trained on a causal language modeling task (i.e., predict the next token).
289
+
290
+ The architecture is broadly adapted from the GPT-3 paper ([Brown et al., 2020](https://arxiv.org/abs/2005.14165)), with the following differences:
291
+
292
+ * **Positionnal embeddings:** rotary ([Su et al., 2021](https://arxiv.org/abs/2104.09864));
293
+ * **Attention:** multiquery ([Shazeer et al., 2019](https://arxiv.org/abs/1911.02150)) and FlashAttention ([Dao et al., 2022](https://arxiv.org/abs/2205.14135));
294
+ * **Decoder-block:** parallel attention/MLP with a single layer norm.
295
+
296
+ For multiquery, we are using an internal variant which uses independent key and values per tensor parallel degree.
297
+
298
+ | **Hyperparameter** | **Value** | **Comment** |
299
+ |--------------------|-----------|----------------------------------------|
300
+ | Layers | 60 | |
301
+ | `d_model` | 8192 | |
302
+ | `head_dim` | 64 | Reduced to optimise for FlashAttention |
303
+ | Vocabulary | 65024 | |
304
+ | Sequence length | 2048 | |
305
+
306
+ ### Compute Infrastructure
307
+
308
+ #### Hardware
309
+
310
+ Falcon-40B-Instruct was trained on AWS SageMaker, on 64 A100 40GB GPUs in P4d instances.
311
+
312
+ #### Software
313
+
314
+ Falcon-40B-Instruct was trained a custom distributed training codebase, Gigatron. It uses a 3D parallelism approach combined with ZeRO and high-performance Triton kernels (FlashAttention, etc.)
315
+
316
+
317
+ ## Citation
318
+
319
+ *Paper coming soon 😊.*
320
+
321
+ ## License
322
+
323
+ Falcon-40B-Instruct is made available under the [TII Falcon LLM License](https://huggingface.co/tiiuae/falcon-40b-instruct/blob/main/LICENSE.txt). Broadly speaking,
324
+ * You can freely use our models for research and/or personal purpose;
325
+ * You are allowed to share and build derivatives of these models, but you are required to give attribution and to share-alike with the same license;
326
+ * For commercial use, you are exempt from royalties payment if the attributable revenues are inferior to $1M/year, otherwise you should enter in a commercial agreement with TII.
327
+
328
+
329
+ ## Contact
330
+ falconllm@tii.ae