slippylolo commited on
Commit
5aad858
β€’
1 Parent(s): 69601d5

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +162 -14
README.md CHANGED
@@ -3,43 +3,191 @@ datasets:
3
  - tiiuae/falcon-refinedweb
4
  language:
5
  - en
 
6
  ---
7
 
8
- # Falcon-7B-Instruct
9
 
10
- **Falcon-7B-Instuct is a 7B parameters causal decoder-only model built by [TII](https://www.tii.ae), based on [Falcon-7B](https://huggingface.co/tiiuae/falcon-7b), and finetuned on an ensemble of instruct datasets. It is made available under the [TII Falcon LLM License](https://huggingface.co/tiiuae/falcon-7b/blob/main/LICENSE.txt).**
11
 
12
- More details coming soon.
13
 
 
14
 
15
- # Model Card for Falcon-7B-Instruct
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
 
 
 
 
 
 
17
 
18
  ## Model Details
19
 
20
  ### Model Description
21
 
22
- - **Developed by:** [https://www.tii.ae](https://www.tii.ae)
23
- - **Model type:** Causal decoder-only
24
- - **Language(s) (NLP):** English
25
- - **License:** TII Falcon LLM License
 
26
 
27
  ### Model Source
28
 
29
- - **Paper:** coming soon
30
- - **Demo:** coming soon
31
 
32
  ## Uses
33
 
 
 
 
 
34
  ### Out-of-Scope Use
35
 
36
- Production use without adequate assessment of risks and mitigation; any use cases which may be considered irresponsible or harmful
37
 
38
  ## Bias, Risks, and Limitations
39
 
40
- Falcon-7B-Instruct is trained on English 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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
 
42
 
43
- ## Paper
 
44
 
45
- More details coming soon in the paper.
 
3
  - tiiuae/falcon-refinedweb
4
  language:
5
  - en
6
+ inference: false
7
  ---
8
 
9
+ # ✨ Falcon-7B-Instruct
10
 
11
+ **Falcon-7B-Instruct is a 7B parameters causal decoder-only model built by [TII](https://www.tii.ae) based on [Falcon-7B](https://huggingface.co/tiiuae/falcon-7b) and finetuned on a mixture of chat/instruct datasets. It is made available under the [TII Falcon LLM License](https://huggingface.co/tiiuae/falcon-7b-instruct/blob/main/LICENSE.txt).**
12
 
13
+ *Paper coming soon 😊.*
14
 
15
+ ## Why use Falcon-7B-Instruct?
16
 
17
+ * **You are looking for a ready-to-use chat/instruct model based on [Falcon-7B](https://huggingface.co/tiiuae/falcon-7b).**
18
+ * **Falcon-7B is a strong base model, outperforming 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).
19
+ * **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)).
20
+
21
+ πŸ’¬ **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-7B](https://huggingface.co/tiiuae/falcon-7b).
22
+
23
+ πŸ”₯ **Looking for an even more powerful model?** [Falcon-40B-Instruct](https://huggingface.co/tiiuae/falcon-40b-instruct) is Falcon-7B-Instruct's big brother!
24
+
25
+ ```python
26
+ from transformers import AutoTokenizer, AutoModelForCausalLM
27
+ import transformers
28
+ import torch
29
+
30
+ model = "tiiuae/falcon-7b-instruct"
31
+
32
+ tokenizer = AutoTokenizer.from_pretrained(model)
33
+ pipeline = transformers.pipeline(
34
+ "text-generation",
35
+ model=model,
36
+ tokenizer=tokenizer,
37
+ torch_dtype=torch.bfloat16,
38
+ trust_remote_code=True,
39
+ device_map="auto",
40
+ )
41
+ sequences = pipeline(
42
+ "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:",
43
+ max_length=200,
44
+ do_sample=True,
45
+ top_k=10,
46
+ num_return_sequences=1,
47
+ eos_token_id=tokenizer.eos_token_id,
48
+ )
49
+ for seq in sequences:
50
+ print(f"Result: {seq['generated_text']}")
51
 
52
+ ```
53
+
54
+
55
+
56
+ # Model Card for Falcon-7B-Instruct
57
 
58
  ## Model Details
59
 
60
  ### Model Description
61
 
62
+ - **Developed by:** [https://www.tii.ae](https://www.tii.ae);
63
+ - **Model type:** Causal decoder-only;
64
+ - **Language(s) (NLP):** English and French;
65
+ - **License:** [TII Falcon LLM License](https://huggingface.co/tiiuae/falcon-7b-instruct/blob/main/LICENSE.txt);
66
+ - **Finetuned from model:** [Falcon-7B](https://huggingface.co/tiiuae/falcon-7b).
67
 
68
  ### Model Source
69
 
70
+ - **Paper:** *coming soon*.
 
71
 
72
  ## Uses
73
 
74
+ ### Direct Use
75
+
76
+ Falcon-7B-Instruct has been finetuned on a mixture of instruct and chat datasets.
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
+ Falcon-7B-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.
85
+
86
+ ### Recommendations
87
+
88
+ We recommend users of Falcon-7B-Instruct to develop guardrails and to take appropriate precautions 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-7b-instruct"
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
+ trust_remote_code=True,
107
+ device_map="auto",
108
+ )
109
+ sequences = pipeline(
110
+ "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:",
111
+ max_length=200,
112
+ do_sample=True,
113
+ top_k=10,
114
+ num_return_sequences=1,
115
+ eos_token_id=tokenizer.eos_token_id,
116
+ )
117
+ for seq in sequences:
118
+ print(f"Result: {seq['generated_text']}")
119
+
120
+ ```
121
+
122
+ ## Training Details
123
+
124
+ ### Training Data
125
+
126
+ Falcon-7B-Instruct was finetuned on a 250M tokens mixture of instruct/chat datasets.
127
+
128
+ | **Data source** | **Fraction** | **Tokens** | **Description** |
129
+ |--------------------|--------------|------------|-----------------------------------|
130
+ | [Bai ze](https://github.com/project-baize/baize-chatbot) | 65% | 164M | chat |
131
+ | [GPT4All](https://github.com/nomic-ai/gpt4all) | 25% | 62M | instruct |
132
+ | [GPTeacher](https://github.com/teknium1/GPTeacher) | 5% | 11M | instruct |
133
+ | [RefinedWeb-English](https://huggingface.co/datasets/tiiuae/falcon-refinedweb) | 5% | 13M | massive web crawl |
134
+
135
+
136
+ The data was tokenized with the Falcon-[7B](https://huggingface.co/tiiuae/falcon-7b)/[40B](https://huggingface.co/tiiuae/falcon-40b) tokenizer.
137
+
138
+
139
+ ## Evaluation
140
+
141
+ *Paper coming soon.*
142
+
143
+ See the [OpenLLM Leaderboard](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard) for early results.
144
+
145
+
146
+ ## Technical Specifications
147
+
148
+ For more information about pretraining, see [Falcon-7B](https://huggingface.co/tiiuae/falcon-7b).
149
+
150
+ ### Model Architecture and Objective
151
+
152
+ Falcon-7B is a causal decoder-only model trained on a causal language modeling task (i.e., predict the next token).
153
+
154
+ The architecture is broadly adapted from the GPT-3 paper ([Brown et al., 2020](https://arxiv.org/abs/2005.14165)), with the following differences:
155
+
156
+ * **Positionnal embeddings:** rotary ([Su et al., 2021](https://arxiv.org/abs/2104.09864));
157
+ * **Attention:** multiquery ([Shazeer et al., 2019](https://arxiv.org/abs/1911.02150)) and FlashAttention ([Dao et al., 2022](https://arxiv.org/abs/2205.14135));
158
+ * **Decoder-block:** parallel attention/MLP with a single layer norm.
159
+
160
+ | **Hyperparameter** | **Value** | **Comment** |
161
+ |--------------------|-----------|----------------------------------------|
162
+ | Layers | 32 | |
163
+ | `d_model` | 4544 | Increased to compensate for multiquery |
164
+ | `head_dim` | 64 | Reduced to optimise for FlashAttention |
165
+ | Vocabulary | 65024 | |
166
+ | Sequence length | 2048 | |
167
+
168
+ ### Compute Infrastructure
169
+
170
+ #### Hardware
171
+
172
+ Falcon-7B-Instruct was trained on AWS SageMaker, on 32 A100 40GB GPUs in P4d instances.
173
+
174
+ #### Software
175
+
176
+ Falcon-7B-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.)
177
+
178
+
179
+ ## Citation
180
+
181
+ *Paper coming soon 😊.*
182
+
183
+ ## License
184
+
185
+ Falcon-7B-Instruct is made available under the [TII Falcon LLM License](https://huggingface.co/tiiuae/falcon-7b-instruct/blob/main/LICENSE.txt). Broadly speaking,
186
+ * You can freely use our models for research and/or personal purpose;
187
+ * 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;
188
+ * 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.
189
 
190
 
191
+ ## Contact
192
+ falconllm@tii.ae
193