Commit
β’
9f70e49
1
Parent(s):
fcd739c
"Update README.md"
Browse files
README.md
CHANGED
@@ -19,10 +19,259 @@ widget:
|
|
19 |
example_title: "Trendy Jobs"
|
20 |
license: apache-2.0
|
21 |
---
|
22 |
-
![banner](https://maddes8cht.github.io/assets/buttons/Huggingface-banner.jpg)
|
|
|
23 |
## I am still building the structure of these descriptions.
|
24 |
-
|
|
|
|
|
|
|
|
|
|
|
25 |
|
26 |
Tiiuae-Falcon 7B instruct is the original instruction following Falcon model from Tiiuae, converted to gguf format.
|
27 |
|
28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
example_title: "Trendy Jobs"
|
20 |
license: apache-2.0
|
21 |
---
|
22 |
+
[![banner](https://maddes8cht.github.io/assets/buttons/Huggingface-banner.jpg)]()
|
23 |
+
|
24 |
## I am still building the structure of these descriptions.
|
25 |
+
|
26 |
+
These will contain increasingly more content to help find the best models for a purpose.
|
27 |
+
|
28 |
+
# falcon-7b-instruct - GGUF
|
29 |
+
- Model creator: [tiiuae](https://huggingface.co/tiiuae)
|
30 |
+
- Original model: [falcon-7b-instruct](https://huggingface.co/tiiuae/falcon-7b-instruct)
|
31 |
|
32 |
Tiiuae-Falcon 7B instruct is the original instruction following Falcon model from Tiiuae, converted to gguf format.
|
33 |
|
34 |
|
35 |
+
|
36 |
+
# About GGUF format
|
37 |
+
|
38 |
+
`gguf` is the current file format used by the [`ggml`](https://github.com/ggerganov/ggml) library.
|
39 |
+
A growing list of Software is using it and can therefore use this model.
|
40 |
+
The core project making use of the ggml library is the [llama.cpp](https://github.com/ggerganov/llama.cpp) project by Georgi Gerganov
|
41 |
+
|
42 |
+
# Quantization variants
|
43 |
+
|
44 |
+
There is a bunch of quantized files available. How to choose the best for you:
|
45 |
+
|
46 |
+
# legacy quants
|
47 |
+
|
48 |
+
Q4_0, Q4_1, Q5_0, Q5_1 and Q8 are `legacy` quantization types.
|
49 |
+
Nevertheless, they are fully supported, as there are several circumstances that cause certain model not to be compatible with the modern K-quants.
|
50 |
+
Falcon 7B models cannot be quantized to K-quants.
|
51 |
+
|
52 |
+
# K-quants
|
53 |
+
|
54 |
+
K-quants are based on the idea that the quantization of certain parts affects the quality in different ways. If you quantize certain parts more and others less, you get a more powerful model with the same file size, or a smaller file size and lower memory load with comparable performance.
|
55 |
+
So, if possible, use K-quants.
|
56 |
+
With a Q6_K you should find it really hard to find a quality difference to the original model - ask your model two times the same question and you may encounter bigger quality differences.
|
57 |
+
|
58 |
+
|
59 |
+
|
60 |
+
# Original Model Card:
|
61 |
+
# β¨ Falcon-7B-Instruct
|
62 |
+
|
63 |
+
**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 Apache 2.0 license.**
|
64 |
+
|
65 |
+
*Paper coming soon π.*
|
66 |
+
|
67 |
+
π€ To get started with Falcon (inference, finetuning, quantization, etc.), we recommend reading [this great blogpost fron HF](https://huggingface.co/blog/falcon)!
|
68 |
+
|
69 |
+
## Why use Falcon-7B-Instruct?
|
70 |
+
|
71 |
+
* **You are looking for a ready-to-use chat/instruct model based on [Falcon-7B](https://huggingface.co/tiiuae/falcon-7b).**
|
72 |
+
* **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).
|
73 |
+
* **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)).
|
74 |
+
|
75 |
+
π¬ **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).
|
76 |
+
|
77 |
+
π₯ **Looking for an even more powerful model?** [Falcon-40B-Instruct](https://huggingface.co/tiiuae/falcon-40b-instruct) is Falcon-7B-Instruct's big brother!
|
78 |
+
|
79 |
+
```python
|
80 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
81 |
+
import transformers
|
82 |
+
import torch
|
83 |
+
|
84 |
+
model = "tiiuae/falcon-7b-instruct"
|
85 |
+
|
86 |
+
tokenizer = AutoTokenizer.from_pretrained(model)
|
87 |
+
pipeline = transformers.pipeline(
|
88 |
+
"text-generation",
|
89 |
+
model=model,
|
90 |
+
tokenizer=tokenizer,
|
91 |
+
torch_dtype=torch.bfloat16,
|
92 |
+
trust_remote_code=True,
|
93 |
+
device_map="auto",
|
94 |
+
)
|
95 |
+
sequences = pipeline(
|
96 |
+
"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:",
|
97 |
+
max_length=200,
|
98 |
+
do_sample=True,
|
99 |
+
top_k=10,
|
100 |
+
num_return_sequences=1,
|
101 |
+
eos_token_id=tokenizer.eos_token_id,
|
102 |
+
)
|
103 |
+
for seq in sequences:
|
104 |
+
print(f"Result: {seq['generated_text']}")
|
105 |
+
|
106 |
+
```
|
107 |
+
|
108 |
+
π₯ **Falcon LLMs require PyTorch 2.0 for use with `transformers`!**
|
109 |
+
|
110 |
+
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).
|
111 |
+
|
112 |
+
You will need **at least 16GB of memory** to swiftly run inference with Falcon-7B-Instruct.
|
113 |
+
|
114 |
+
|
115 |
+
# Model Card for Falcon-7B-Instruct
|
116 |
+
|
117 |
+
## Model Details
|
118 |
+
|
119 |
+
### Model Description
|
120 |
+
|
121 |
+
- **Developed by:** [https://www.tii.ae](https://www.tii.ae);
|
122 |
+
- **Model type:** Causal decoder-only;
|
123 |
+
- **Language(s) (NLP):** English and French;
|
124 |
+
- **License:** Apache 2.0;
|
125 |
+
- **Finetuned from model:** [Falcon-7B](https://huggingface.co/tiiuae/falcon-7b).
|
126 |
+
|
127 |
+
### Model Source
|
128 |
+
|
129 |
+
- **Paper:** *coming soon*.
|
130 |
+
|
131 |
+
## Uses
|
132 |
+
|
133 |
+
### Direct Use
|
134 |
+
|
135 |
+
Falcon-7B-Instruct has been finetuned on a mixture of instruct and chat datasets.
|
136 |
+
|
137 |
+
### Out-of-Scope Use
|
138 |
+
|
139 |
+
Production use without adequate assessment of risks and mitigation; any use cases which may be considered irresponsible or harmful.
|
140 |
+
|
141 |
+
## Bias, Risks, and Limitations
|
142 |
+
|
143 |
+
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.
|
144 |
+
|
145 |
+
### Recommendations
|
146 |
+
|
147 |
+
We recommend users of Falcon-7B-Instruct to develop guardrails and to take appropriate precautions for any production use.
|
148 |
+
|
149 |
+
## How to Get Started with the Model
|
150 |
+
|
151 |
+
|
152 |
+
```python
|
153 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
154 |
+
import transformers
|
155 |
+
import torch
|
156 |
+
|
157 |
+
model = "tiiuae/falcon-7b-instruct"
|
158 |
+
|
159 |
+
tokenizer = AutoTokenizer.from_pretrained(model)
|
160 |
+
pipeline = transformers.pipeline(
|
161 |
+
"text-generation",
|
162 |
+
model=model,
|
163 |
+
tokenizer=tokenizer,
|
164 |
+
torch_dtype=torch.bfloat16,
|
165 |
+
trust_remote_code=True,
|
166 |
+
device_map="auto",
|
167 |
+
)
|
168 |
+
sequences = pipeline(
|
169 |
+
"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:",
|
170 |
+
max_length=200,
|
171 |
+
do_sample=True,
|
172 |
+
top_k=10,
|
173 |
+
num_return_sequences=1,
|
174 |
+
eos_token_id=tokenizer.eos_token_id,
|
175 |
+
)
|
176 |
+
for seq in sequences:
|
177 |
+
print(f"Result: {seq['generated_text']}")
|
178 |
+
|
179 |
+
```
|
180 |
+
|
181 |
+
## Training Details
|
182 |
+
|
183 |
+
### Training Data
|
184 |
+
|
185 |
+
Falcon-7B-Instruct was finetuned on a 250M tokens mixture of instruct/chat datasets.
|
186 |
+
|
187 |
+
| **Data source** | **Fraction** | **Tokens** | **Description** |
|
188 |
+
|--------------------|--------------|------------|-----------------------------------|
|
189 |
+
| [Bai ze](https://github.com/project-baize/baize-chatbot) | 65% | 164M | chat |
|
190 |
+
| [GPT4All](https://github.com/nomic-ai/gpt4all) | 25% | 62M | instruct |
|
191 |
+
| [GPTeacher](https://github.com/teknium1/GPTeacher) | 5% | 11M | instruct |
|
192 |
+
| [RefinedWeb-English](https://huggingface.co/datasets/tiiuae/falcon-refinedweb) | 5% | 13M | massive web crawl |
|
193 |
+
|
194 |
+
|
195 |
+
The data was tokenized with the Falcon-[7B](https://huggingface.co/tiiuae/falcon-7b)/[40B](https://huggingface.co/tiiuae/falcon-40b) tokenizer.
|
196 |
+
|
197 |
+
|
198 |
+
## Evaluation
|
199 |
+
|
200 |
+
*Paper coming soon.*
|
201 |
+
|
202 |
+
See the [OpenLLM Leaderboard](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard) for early results.
|
203 |
+
|
204 |
+
Note that this model variant is not optimized for NLP benchmarks.
|
205 |
+
|
206 |
+
|
207 |
+
## Technical Specifications
|
208 |
+
|
209 |
+
For more information about pretraining, see [Falcon-7B](https://huggingface.co/tiiuae/falcon-7b).
|
210 |
+
|
211 |
+
### Model Architecture and Objective
|
212 |
+
|
213 |
+
Falcon-7B is a causal decoder-only model trained on a causal language modeling task (i.e., predict the next token).
|
214 |
+
|
215 |
+
The architecture is broadly adapted from the GPT-3 paper ([Brown et al., 2020](https://arxiv.org/abs/2005.14165)), with the following differences:
|
216 |
+
|
217 |
+
* **Positionnal embeddings:** rotary ([Su et al., 2021](https://arxiv.org/abs/2104.09864));
|
218 |
+
* **Attention:** multiquery ([Shazeer et al., 2019](https://arxiv.org/abs/1911.02150)) and FlashAttention ([Dao et al., 2022](https://arxiv.org/abs/2205.14135));
|
219 |
+
* **Decoder-block:** parallel attention/MLP with a single layer norm.
|
220 |
+
|
221 |
+
| **Hyperparameter** | **Value** | **Comment** |
|
222 |
+
|--------------------|-----------|----------------------------------------|
|
223 |
+
| Layers | 32 | |
|
224 |
+
| `d_model` | 4544 | Increased to compensate for multiquery |
|
225 |
+
| `head_dim` | 64 | Reduced to optimise for FlashAttention |
|
226 |
+
| Vocabulary | 65024 | |
|
227 |
+
| Sequence length | 2048 | |
|
228 |
+
|
229 |
+
### Compute Infrastructure
|
230 |
+
|
231 |
+
#### Hardware
|
232 |
+
|
233 |
+
Falcon-7B-Instruct was trained on AWS SageMaker, on 32 A100 40GB GPUs in P4d instances.
|
234 |
+
|
235 |
+
#### Software
|
236 |
+
|
237 |
+
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.)
|
238 |
+
|
239 |
+
|
240 |
+
## Citation
|
241 |
+
|
242 |
+
*Paper coming soon* π. In the meanwhile, you can use the following information to cite:
|
243 |
+
```
|
244 |
+
@article{falcon40b,
|
245 |
+
title={{Falcon-40B}: an open large language model with state-of-the-art performance},
|
246 |
+
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},
|
247 |
+
year={2023}
|
248 |
+
}
|
249 |
+
```
|
250 |
+
|
251 |
+
To learn more about the pretraining dataset, see the π [RefinedWeb paper](https://arxiv.org/abs/2306.01116).
|
252 |
+
|
253 |
+
```
|
254 |
+
@article{refinedweb,
|
255 |
+
title={The {R}efined{W}eb dataset for {F}alcon {LLM}: outperforming curated corpora with web data, and web data only},
|
256 |
+
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},
|
257 |
+
journal={arXiv preprint arXiv:2306.01116},
|
258 |
+
eprint={2306.01116},
|
259 |
+
eprinttype = {arXiv},
|
260 |
+
url={https://arxiv.org/abs/2306.01116},
|
261 |
+
year={2023}
|
262 |
+
}
|
263 |
+
```
|
264 |
+
|
265 |
+
|
266 |
+
## License
|
267 |
+
|
268 |
+
Falcon-7B-Instruct is made available under the Apache 2.0 license.
|
269 |
+
|
270 |
+
## Contact
|
271 |
+
falconllm@tii.ae<center>
|
272 |
+
[![GitHub](https://maddes8cht.github.io/assets/buttons/github-io-button.png)](https://maddes8cht.github.io)
|
273 |
+
[![Stack Exchange](https://stackexchange.com/users/flair/26485911.png)](https://stackexchange.com/users/26485911)
|
274 |
+
[![GitHub](https://maddes8cht.github.io/assets/buttons/github-button.png)](https://github.com/maddes8cht)
|
275 |
+
[![HuggingFace](https://maddes8cht.github.io/assets/buttons/huggingface-button.png)](https://huggingface.co/maddes8cht)
|
276 |
+
[![Twitter](https://maddes8cht.github.io/assets/buttons/twitter-button.png)](https://twitter.com/maddes1966)
|
277 |
+
</center>
|