GGUF
conversational
vsevolodl commited on
Commit
a438d61
โ€ข
1 Parent(s): 57ca716

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +218 -0
README.md ADDED
@@ -0,0 +1,218 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ datasets:
3
+ - tiiuae/falcon-refinedweb
4
+ language:
5
+ - en
6
+ - de
7
+ - es
8
+ - fr
9
+ inference: false
10
+ ---
11
+ # Quants of [tiiuae/falcon-11B](https://huggingface.co/tiiuae/falcon-11B)
12
+
13
+ # Original README.md
14
+
15
+ # ๐Ÿš€ Falcon2-11B
16
+
17
+ **Falcon2-11B is an 11B parameters causal decoder-only model built by [TII](https://www.tii.ae) and trained on over 5,000B tokens of [RefinedWeb](https://huggingface.co/datasets/tiiuae/falcon-refinedweb) enhanced with curated corpora. The model is made available under the [TII Falcon License 2.0](https://falconllm-staging.tii.ae/falcon-2-terms-and-conditions.html), the permissive Apache 2.0-based software license which includes an [acceptable use policy](https://falconllm-staging.tii.ae/falcon-2-acceptable-use-policy.html) that promotes the responsible use of AI.**
18
+
19
+ *Paper coming soon ๐Ÿ˜Š.*
20
+
21
+
22
+ ๐Ÿค— To get started with Falcon (inference, finetuning, quantization, etc.), we recommend reading [this great blogpost from HF](https://huggingface.co/blog/falcon)!
23
+
24
+ โš ๏ธ **This is a raw, pretrained model, which should be further finetuned for most usecases.**
25
+
26
+ ```python
27
+ from transformers import AutoTokenizer, AutoModelForCausalLM
28
+ import transformers
29
+ import torch
30
+
31
+ model = "tiiuae/falcon-11B"
32
+
33
+ tokenizer = AutoTokenizer.from_pretrained(model)
34
+ pipeline = transformers.pipeline(
35
+ "text-generation",
36
+ model=model,
37
+ tokenizer=tokenizer,
38
+ torch_dtype=torch.bfloat16,
39
+ )
40
+ sequences = pipeline(
41
+ "Can you explain the concepts of Quantum Computing?",
42
+ max_length=200,
43
+ do_sample=True,
44
+ top_k=10,
45
+ num_return_sequences=1,
46
+ eos_token_id=tokenizer.eos_token_id,
47
+ )
48
+ for seq in sequences:
49
+ print(f"Result: {seq['generated_text']}")
50
+
51
+ ```
52
+
53
+ ๐Ÿ’ฅ **Falcon LLMs require PyTorch 2.0 for use with `transformers`!**
54
+
55
+ 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).
56
+
57
+ # Model Card for Falcon2-11B
58
+
59
+ ## Model Details
60
+
61
+ ### Model Description
62
+
63
+ - **Developed by:** [https://www.tii.ae](https://www.tii.ae)
64
+ - **Model type:** Causal decoder-only
65
+ - **Language(s) (NLP):** English, German, Spanish, French, Italian, Portuguese, Polish, Dutch, Romanian, Czech, Swedish
66
+ - **License:** [TII Falcon License 2.0](https://falconllm-staging.tii.ae/falcon-2-terms-and-conditions.html)
67
+
68
+ ### Model Source
69
+
70
+ - **Paper:** *coming soon*.
71
+
72
+ ## Uses
73
+
74
+ ### Direct Use
75
+
76
+ Research on large language models; as a foundation for further specialization and finetuning for specific usecases (e.g., summarization, text generation, chatbot, etc.)
77
+
78
+ ### Out-of-Scope Use
79
+
80
+ Production use without adequate assessment of risks and mitigation; any use cases which may be considered irresponsible or harmful.
81
+
82
+ ## Bias, Risks, and Limitations
83
+
84
+ Falcon2-11B is trained mostly on English, but also German, Spanish, French, 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.
85
+
86
+ ### Recommendations
87
+
88
+ We recommend users of Falcon2-11B 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.
89
+
90
+ ## How to Get Started with the Model
91
+
92
+
93
+ ```python
94
+ from transformers import AutoTokenizer, AutoModelForCausalLM
95
+ import transformers
96
+ import torch
97
+
98
+ model = "tiiuae/falcon-11B"
99
+
100
+ tokenizer = AutoTokenizer.from_pretrained(model)
101
+ pipeline = transformers.pipeline(
102
+ "text-generation",
103
+ model=model,
104
+ tokenizer=tokenizer,
105
+ torch_dtype=torch.bfloat16,
106
+ device_map="auto",
107
+ )
108
+ sequences = pipeline(
109
+ "Can you explain the concepts of Quantum Computing?",
110
+ max_length=200,
111
+ do_sample=True,
112
+ top_k=10,
113
+ num_return_sequences=1,
114
+ eos_token_id=tokenizer.eos_token_id,
115
+ )
116
+ for seq in sequences:
117
+ print(f"Result: {seq['generated_text']}")
118
+
119
+ ```
120
+
121
+ ## Training Details
122
+
123
+ ### Training Data
124
+
125
+ Falcon2-11B was trained over 5,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. It followed a four stage training strategy. The first three stages were focused on increasing the context length, from to 2048 to 4096 and finally to 8192 tokens. The last stage aimed to further enhance performance using only high quality data.
126
+
127
+ Overall, the data sources included RefinedWeb-English, Refined Web-Europe (cs, de, es, fr, it, nl, pl, pt, ro, sv), high quality technical data, code data, and conversational data extracted from public sources.
128
+
129
+
130
+ The training stages were as follows:
131
+
132
+ | **Stage** | **Context length** | **Tokens** |
133
+ |--------------|-----------------|-------------|
134
+ | Stage 1 | 2048 | 4500 B |
135
+ | Stage 2 | 4096 | 250 B |
136
+ | Stage 3 | 8192 | 250 B |
137
+ | Stage 4 | 8192 | 500 B |
138
+
139
+
140
+ The data was tokenized with the Falcon-[7B](https://huggingface.co/tiiuae/falcon-7b)/[11B](https://huggingface.co/tiiuae/falcon-11B) tokenizer.
141
+
142
+ ### Training Procedure
143
+
144
+ Falcon2-11B was trained on 1024 A100 40GB GPUs for the majority of the training, using a 3D parallelism strategy (TP=8, PP=1, DP=128) combined with ZeRO and Flash-Attention 2.
145
+
146
+ #### Training Hyperparameters
147
+
148
+ | **Hyperparameter** | **Value** | **Comment** |
149
+ |--------------------|------------|-------------------------------------------|
150
+ | Precision | `bfloat16` | |
151
+ | Optimizer | AdamW | |
152
+ | Max learning rate | 3.7e-4 | Following a linear warm-up, then cosine decay to 1.89e-5 across 4500 B tokens. |
153
+ | Weight decay | 1e-1 | |
154
+ | Z-loss | 1e-4 | |
155
+ | Batch size | Variable | Batch size was gradually increased during the training |
156
+
157
+
158
+ #### Speeds, Sizes, Times
159
+
160
+ The model training took roughly two months.
161
+
162
+
163
+ ## Evaluation
164
+
165
+ |English Benchmark | **Value** |
166
+ |--------------------|------------|
167
+ | ARC-Challenge-25shots | 59.73 |
168
+ | HellaSwag-10shots | 82.91 |
169
+ | MMLU-5shots | 58.37 |
170
+ | Winogrande-5shots | 78.30 |
171
+ | TruthfulQA-0shot | 52.56 |
172
+ | GSM8k-5shots | 53.83 |
173
+ | ARC-Challenge-0shot | 50.17 |
174
+ | ARC-Easy-0shot | 77.78 |
175
+ | Hellaswag-0shot | 82.07 |
176
+
177
+ We thank the leaderboard team from HuggingFace for providing an official evaluation of our model on the leaderboard tasks.
178
+
179
+ ## Technical Specifications
180
+
181
+ ### Model Architecture and Objective
182
+
183
+ Falcon2-11B is a causal decoder-only model trained on a causal language modeling task (i.e., predict the next token).
184
+
185
+ The architecture is broadly adapted from the GPT-3 paper ([Brown et al., 2020](https://arxiv.org/abs/2005.14165)), with the following differences:
186
+
187
+ * **Positional embeddings:** rotary ([Su et al., 2021](https://arxiv.org/abs/2104.09864));
188
+ * **Attention:** multiquery ([Shazeer et al., 2019](https://arxiv.org/abs/1911.02150)) and FlashAttention-2 ([Dao, 2023](https://arxiv.org/abs/2307.08691));
189
+ * **Decoder-block:** parallel attention/MLP.
190
+
191
+ | **Hyperparameter** | **Value** | **Comment** |
192
+ |--------------------|-----------|----------------------------------------|
193
+ | Layers | 60 | |
194
+ | `d_model` | 4096 | |
195
+ | `head_dim` | 128 | |
196
+ | Vocabulary | 65024 | |
197
+ | Sequence length | 8192 | During stages 3 and 4 |
198
+
199
+ ### Compute Infrastructure
200
+
201
+ #### Hardware
202
+
203
+ Falcon2-11B was trained on AWS SageMaker, using on average 1024 A100 40GB GPUs in 128 p4d instances.
204
+
205
+ #### Software
206
+
207
+ Falcon2-11B was trained a custom distributed training codebase, Gigatron. It uses a 3D parallelism approach combined with ZeRO, high-performance Triton kernels and FlashAttention-2. More details about the distributed training strategy can be found in [Almazrouei et.al](https://arxiv.org/abs/2311.16867).
208
+
209
+ ## Citation
210
+
211
+ *Paper coming soon* ๐Ÿ˜Š.
212
+
213
+ ## License
214
+
215
+ Falcon2-11B is licenced under [TII Falcon License 2.0](https://falconllm-staging.tii.ae/falcon-2-terms-and-conditions.html), the permissive Apache 2.0-based software license which includes an [acceptable use policy](https://falconllm-staging.tii.ae/falcon-2-acceptable-use-policy.html) that promotes the responsible use of AI.
216
+
217
+ ## Contact
218