GGUF
English
llama-cpp
gguf-my-repo
Triangle104 commited on
Commit
6c99c0c
β€’
1 Parent(s): 1ef2d12

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +189 -0
README.md CHANGED
@@ -16,6 +16,195 @@ tags:
16
  This model was converted to GGUF format from [`tiiuae/falcon-7b`](https://huggingface.co/tiiuae/falcon-7b) using llama.cpp via the ggml.ai's [GGUF-my-repo](https://huggingface.co/spaces/ggml-org/gguf-my-repo) space.
17
  Refer to the [original model card](https://huggingface.co/tiiuae/falcon-7b) for more details on the model.
18
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  ## Use with llama.cpp
20
  Install llama.cpp through brew (works on Mac and Linux)
21
 
 
16
  This model was converted to GGUF format from [`tiiuae/falcon-7b`](https://huggingface.co/tiiuae/falcon-7b) using llama.cpp via the ggml.ai's [GGUF-my-repo](https://huggingface.co/spaces/ggml-org/gguf-my-repo) space.
17
  Refer to the [original model card](https://huggingface.co/tiiuae/falcon-7b) for more details on the model.
18
 
19
+ ---
20
+ Model details:
21
+ -
22
+ Falcon-7B is a 7B parameters causal decoder-only model built by TII and trained on 1,500B tokens of RefinedWeb enhanced with curated corpora. It is made available under the Apache 2.0 license.
23
+
24
+ Paper coming soon 😊.
25
+
26
+ πŸ€— To get started with Falcon (inference, finetuning, quantization, etc.), we recommend reading this great blogpost fron HF!
27
+ Why use Falcon-7B?
28
+
29
+ It outperforms comparable open-source models (e.g., MPT-7B, StableLM, RedPajama etc.), thanks to being trained on 1,500B tokens of RefinedWeb enhanced with curated corpora. See the OpenLLM Leaderboard.
30
+ It features an architecture optimized for inference, with FlashAttention (Dao et al., 2022) and multiquery (Shazeer et al., 2019).
31
+ It is made available under a permissive Apache 2.0 license allowing for commercial use, without any royalties or restrictions.
32
+
33
+ ⚠️ 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.
34
+
35
+ πŸ”₯ Looking for an even more powerful model? Falcon-40B is Falcon-7B's big brother!
36
+
37
+ from transformers import AutoTokenizer, AutoModelForCausalLM
38
+ import transformers
39
+ import torch
40
+
41
+ model = "tiiuae/falcon-7b"
42
+
43
+ tokenizer = AutoTokenizer.from_pretrained(model)
44
+ pipeline = transformers.pipeline(
45
+ "text-generation",
46
+ model=model,
47
+ tokenizer=tokenizer,
48
+ torch_dtype=torch.bfloat16,
49
+ trust_remote_code=True,
50
+ device_map="auto",
51
+ )
52
+ sequences = pipeline(
53
+ "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:",
54
+ max_length=200,
55
+ do_sample=True,
56
+ top_k=10,
57
+ num_return_sequences=1,
58
+ eos_token_id=tokenizer.eos_token_id,
59
+ )
60
+ for seq in sequences:
61
+ print(f"Result: {seq['generated_text']}")
62
+
63
+ πŸ’₯ Falcon LLMs require PyTorch 2.0 for use with transformers!
64
+
65
+ For fast inference with Falcon, check-out Text Generation Inference! Read more in this blogpost.
66
+
67
+ You will need at least 16GB of memory to swiftly run inference with Falcon-7B.
68
+ Model Card for Falcon-7B
69
+ Model Details
70
+ Model Description
71
+
72
+ Developed by: https://www.tii.ae;
73
+ Model type: Causal decoder-only;
74
+ Language(s) (NLP): English, German, Spanish, French (and limited capabilities in Italian, Portuguese, Polish, Dutch, Romanian, Czech, Swedish);
75
+ License: Apache 2.0.
76
+
77
+ Model Source
78
+
79
+ Paper: coming soon.
80
+
81
+ Uses
82
+ Direct Use
83
+
84
+ Research on large language models; as a foundation for further specialization and finetuning for specific usecases (e.g., summarization, text generation, chatbot, etc.)
85
+ Out-of-Scope Use
86
+
87
+ Production use without adequate assessment of risks and mitigation; any use cases which may be considered irresponsible or harmful.
88
+ Bias, Risks, and Limitations
89
+
90
+ 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.
91
+ Recommendations
92
+
93
+ 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.
94
+ How to Get Started with the Model
95
+
96
+ from transformers import AutoTokenizer, AutoModelForCausalLM
97
+ import transformers
98
+ import torch
99
+
100
+ model = "tiiuae/falcon-7b"
101
+
102
+ tokenizer = AutoTokenizer.from_pretrained(model)
103
+ pipeline = transformers.pipeline(
104
+ "text-generation",
105
+ model=model,
106
+ tokenizer=tokenizer,
107
+ torch_dtype=torch.bfloat16,
108
+ trust_remote_code=True,
109
+ device_map="auto",
110
+ )
111
+ sequences = pipeline(
112
+ "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:",
113
+ max_length=200,
114
+ do_sample=True,
115
+ top_k=10,
116
+ num_return_sequences=1,
117
+ eos_token_id=tokenizer.eos_token_id,
118
+ )
119
+ for seq in sequences:
120
+ print(f"Result: {seq['generated_text']}")
121
+
122
+ Training Details
123
+ Training Data
124
+
125
+ Falcon-7B was trained on 1,500B tokens of 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).
126
+ Data source Fraction Tokens Sources
127
+ RefinedWeb-English 79% 1,185B massive web crawl
128
+ Books 7% 110B
129
+ Conversations 6% 85B Reddit, StackOverflow, HackerNews
130
+ Code 3% 45B
131
+ RefinedWeb-French 3% 45B massive web crawl
132
+ Technical 2% 30B arXiv, PubMed, USPTO, etc.
133
+
134
+ The data was tokenized with the Falcon-7B/40B tokenizer.
135
+ Training Procedure
136
+
137
+ Falcon-7B was trained on 384 A100 40GB GPUs, using a 2D parallelism strategy (PP=2, DP=192) combined with ZeRO.
138
+ Training Hyperparameters
139
+ Hyperparameter Value Comment
140
+ Precision bfloat16
141
+ Optimizer AdamW
142
+ Learning rate 6e-4 4B tokens warm-up, cosine decay to 1.2e-5
143
+ Weight decay 1e-1
144
+ Z-loss 1e-4
145
+ Batch size 2304 30B tokens ramp-up
146
+ Speeds, Sizes, Times
147
+
148
+ Training happened in early March 2023 and took about two weeks.
149
+ Evaluation
150
+
151
+ Paper coming soon.
152
+
153
+ See the OpenLLM Leaderboard for early results.
154
+ Technical Specifications
155
+ Model Architecture and Objective
156
+
157
+ Falcon-7B is a causal decoder-only model trained on a causal language modeling task (i.e., predict the next token).
158
+
159
+ The architecture is broadly adapted from the GPT-3 paper (Brown et al., 2020), with the following differences:
160
+
161
+ Positionnal embeddings: rotary (Su et al., 2021);
162
+ Attention: multiquery (Shazeer et al., 2019) and FlashAttention (Dao et al., 2022);
163
+ Decoder-block: parallel attention/MLP with a single layer norm.
164
+
165
+ Hyperparameter Value Comment
166
+ Layers 32
167
+ d_model 4544 Increased to compensate for multiquery
168
+ head_dim 64 Reduced to optimise for FlashAttention
169
+ Vocabulary 65024
170
+ Sequence length 2048
171
+ Compute Infrastructure
172
+ Hardware
173
+
174
+ Falcon-7B was trained on AWS SageMaker, on 384 A100 40GB GPUs in P4d instances.
175
+ Software
176
+
177
+ 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.)
178
+ Citation
179
+
180
+ Paper coming soon 😊. In the meanwhile, you can use the following information to cite:
181
+
182
+ @article{falcon40b,
183
+ title={{Falcon-40B}: an open large language model with state-of-the-art performance},
184
+ 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},
185
+ year={2023}
186
+ }
187
+
188
+ To learn more about the pretraining dataset, see the πŸ““ RefinedWeb paper.
189
+
190
+ @article{refinedweb,
191
+ title={The {R}efined{W}eb dataset for {F}alcon {LLM}: outperforming curated corpora with web data, and web data only},
192
+ 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},
193
+ journal={arXiv preprint arXiv:2306.01116},
194
+ eprint={2306.01116},
195
+ eprinttype = {arXiv},
196
+ url={https://arxiv.org/abs/2306.01116},
197
+ year={2023}
198
+ }
199
+
200
+ License
201
+
202
+ Falcon-7B is made available under the Apache 2.0 license.
203
+ Contact
204
+
205
206
+
207
+ ---
208
  ## Use with llama.cpp
209
  Install llama.cpp through brew (works on Mac and Linux)
210