You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat: edit falcon mamba card
* fix: edit statement on falconmamba arch
* Update docs/source/en/model_doc/falcon_mamba.md
Co-authored-by: Steven Liu <[email protected]>
* Update docs/source/en/model_doc/falcon_mamba.md
Co-authored-by: Steven Liu <[email protected]>
* Update docs/source/en/model_doc/falcon_mamba.md
Co-authored-by: Steven Liu <[email protected]>
* fix: add right indent for tags
* fix: remove notas
---------
Co-authored-by: Steven Liu <[email protected]>
The FalconMamba model was proposed by TII UAE (Technology Innovation Institute) in their release.
26
-
27
-
The abstract from the paper is the following:
28
-
29
-
*We present FalconMamba, a new base large language model based on the novel Mamba architecture. FalconMamba is trained on 5.8 trillion tokens with carefully selected data mixtures. As a pure Mamba-based model, FalconMamba surpasses leading open-weight models based on Transformers, such as Mistral 7B, Llama3 8B, and Falcon2 11B. It is on par with Gemma 7B and outperforms models with different architecture designs, such as RecurrentGemma 9B. Currently, FalconMamba is the best-performing Mamba model in the literature at this scale, surpassing both existing Mamba and hybrid Mamba-Transformer models.
30
-
Due to its architecture, FalconMamba is significantly faster at inference and requires substantially less memory for long sequence generation. Despite recent studies suggesting that hybrid Mamba-Transformer models outperform pure architecture designs, we argue and demonstrate that the pure Mamba design can achieve similar, even superior results compared to the hybrid design. We make the weights of our implementation of FalconMamba publicly available under a permissive license.*
31
-
32
-
Tips:
23
+
# FalconMamba
33
24
34
-
-FalconMamba is mostly based on Mamba architecture, the same [tips and best practices](./mamba) would be relevant here.
25
+
[FalconMamba](https://huggingface.co/papers/2410.05355) is a 7B large language model, available as pretrained and instruction-tuned variants, based on the [Mamba](./mamba). This model implements a pure Mamba design that focuses on computational efficiency while maintaining strong performance. FalconMamba is significantly faster at inference and requires substantially less memory for long sequence generation. The models are pretrained on a diverse 5.8T token dataset including [RefinedWeb](https://huggingface.co/datasets/tiiuae/falcon-refinedweb), technical content, code, and mathematical data.
35
26
36
-
The model has been trained on approximtely 6T tokens consisting a mixture of many data sources such as RefineWeb, Cosmopedia and Math data.
27
+
You can find the official FalconMamba checkpoints in the [FalconMamba 7B](https://huggingface.co/collections/tiiuae/falconmamba-7b-66b9a580324dd1598b0f6d4a) collection.
37
28
38
-
For more details about the training procedure and the architecture, have a look at [the technical paper of FalconMamba]() (coming soon).
29
+
> [!TIP]
30
+
> Click on the FalconMamba models in the right sidebar for more examples of how to apply FalconMamba to different language tasks.
39
31
40
-
# Usage
32
+
The examples below demonstrate how to generate text with [`Pipeline`], [`AutoModel`], and from the command line.
41
33
42
-
Below we demonstrate how to use the model:
34
+
<hfoptionsid="usage">
35
+
<hfoptionid="Pipeline">
43
36
44
-
```python
45
-
from transformers import FalconMambaForCausalLM, AutoTokenizer
model = FalconMambaForCausalLM.from_pretrained("tiiuae/falcon-mamba-7b", quantization_config=quantization_config)
78
+
```bash
79
+
transformers-cli chat --model_name_or_path tiiuae/falcon-mamba-7b-instruct --torch_dtype auto --device 0
80
+
```
82
81
83
-
input_ids = tokenizer("Hey how are you doing?", return_tensors="pt")["input_ids"]
82
+
</hfoption>
83
+
</hfoptions>
84
84
85
-
out = model.generate(input_ids, max_new_tokens=10)
86
-
print(tokenizer.batch_decode(out))
87
-
```
85
+
Quantization reduces the memory burden of large models by representing the weights in a lower precision. Refer to the [Quantization](../quantization/overview) overview for more available quantization backends.
88
86
89
-
You can also play with the instruction fine-tuned model:
87
+
The example below uses [bitsandbytes](../quantization/bitsandbytes) to quantize the weights to 4-bits.
90
88
91
-
```python
92
-
from transformers import FalconMambaForCausalLM, AutoTokenizer
89
+
```python
93
90
import torch
91
+
from transformers import AutoTokenizer, FalconMambaForCausalLM, BitsAndBytesConfig
0 commit comments