slim.frikha
commited on
Commit
·
fe9695a
0
Parent(s):
falcon3 release
Browse files- .gitattributes +35 -0
- README.md +155 -0
- config.json +37 -0
- generation_config.json +7 -0
- model.safetensors +3 -0
- special_tokens_map.json +41 -0
- tokenizer.json +0 -0
- tokenizer_config.json +0 -0
.gitattributes
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 28 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 29 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 30 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 31 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 32 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 33 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
- fr
|
| 5 |
+
- es
|
| 6 |
+
- pt
|
| 7 |
+
tags:
|
| 8 |
+
- falcon3
|
| 9 |
+
base_model: tiiuae/Falcon3-3B-Instruct
|
| 10 |
+
license: other
|
| 11 |
+
license_name: falcon-llm-license
|
| 12 |
+
license_link: https://falconllm.tii.ae/falcon-terms-and-conditions.html
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
<div align="center">
|
| 16 |
+
<img src="https://huggingface.co/datasets/tiiuae/documentation-images/resolve/main/general/falco3-logo.png" alt="drawing" width="500"/>
|
| 17 |
+
</div>
|
| 18 |
+
|
| 19 |
+
# Falcon3-3B-Instruct-AWQ
|
| 20 |
+
|
| 21 |
+
**Falcon3** family of Open Foundation Models is a set of pretrained and instruct LLMs ranging from 1B to 10B parameters.
|
| 22 |
+
|
| 23 |
+
**Falcon3-3B-Instruct** achieves strong results on reasoning, language understanding, instruction following, code and mathematics tasks.
|
| 24 |
+
Falcon3-3B-Instruct supports 4 languages (English, French, Spanish, Portuguese) and a context length of up to 32K.
|
| 25 |
+
|
| 26 |
+
This repository contains the AWQ-quantized 4-bit instruction-tuned 3B Falcon3 model.
|
| 27 |
+
|
| 28 |
+
## Model Details
|
| 29 |
+
- Architecture
|
| 30 |
+
- Transformer-based causal decoder-only architecture
|
| 31 |
+
- 22 decoder blocks
|
| 32 |
+
- Grouped Query Attention (GQA) for faster inference: 12 query heads and 4 key-value heads
|
| 33 |
+
- Wider head dimension: 256
|
| 34 |
+
- High RoPE value to support long context understanding: 1000042
|
| 35 |
+
- Uses SwiGLU and RMSNorm
|
| 36 |
+
- 32K context length
|
| 37 |
+
- 131K vocab size
|
| 38 |
+
- Pruned and healed from Falcon3-7B-Base on only 100 Gigatokens of datasets comprising of web, code, STEM, high quality and mutlilingual data using 1024 H100 GPU chips
|
| 39 |
+
- Posttrained on 1.2 million samples of STEM, conversational, code, safety and function call data
|
| 40 |
+
- Supports EN, FR, ES, PT
|
| 41 |
+
- Developed by [Technology Innovation Institute](https://www.tii.ae)
|
| 42 |
+
- License: TII Falcon-LLM License 2.0
|
| 43 |
+
- Model Release Date: December 2024
|
| 44 |
+
- Quantization: AWQ 4-bit
|
| 45 |
+
|
| 46 |
+
## Getting started
|
| 47 |
+
|
| 48 |
+
<details>
|
| 49 |
+
<summary> Click to expand </summary>
|
| 50 |
+
|
| 51 |
+
```python
|
| 52 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
model_name = "tiiuae/Falcon3-3B-Instruct-AWQ"
|
| 56 |
+
|
| 57 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 58 |
+
model_name,
|
| 59 |
+
torch_dtype="auto",
|
| 60 |
+
device_map="auto"
|
| 61 |
+
)
|
| 62 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 63 |
+
|
| 64 |
+
prompt = "How many hours in one day?"
|
| 65 |
+
messages = [
|
| 66 |
+
{"role": "system", "content": "You are a helpful friendly assistant Falcon3 from TII, try to follow instructions as much as possible."},
|
| 67 |
+
{"role": "user", "content": prompt}
|
| 68 |
+
]
|
| 69 |
+
text = tokenizer.apply_chat_template(
|
| 70 |
+
messages,
|
| 71 |
+
tokenize=False,
|
| 72 |
+
add_generation_prompt=True
|
| 73 |
+
)
|
| 74 |
+
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
|
| 75 |
+
|
| 76 |
+
generated_ids = model.generate(
|
| 77 |
+
**model_inputs,
|
| 78 |
+
max_new_tokens=1024
|
| 79 |
+
)
|
| 80 |
+
generated_ids = [
|
| 81 |
+
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
|
| 82 |
+
]
|
| 83 |
+
|
| 84 |
+
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
| 85 |
+
print(response)
|
| 86 |
+
```
|
| 87 |
+
|
| 88 |
+
</details>
|
| 89 |
+
|
| 90 |
+
<br>
|
| 91 |
+
|
| 92 |
+
## Benchmarks
|
| 93 |
+
We report in the following table our internal pipeline benchmarks:
|
| 94 |
+
|
| 95 |
+
<table border="1" style="width: 100%; text-align: center; border-collapse: collapse;">
|
| 96 |
+
<colgroup>
|
| 97 |
+
<col style="width: 10%;">
|
| 98 |
+
<col style="width: 10%;">
|
| 99 |
+
<col style="width: 10%;">
|
| 100 |
+
<col style="width: 10%;">
|
| 101 |
+
<col style="background-color: rgba(80, 15, 213, 0.5); width: 7%;">
|
| 102 |
+
</colgroup>
|
| 103 |
+
<thead>
|
| 104 |
+
<tr>
|
| 105 |
+
<th>Benchmark</th>
|
| 106 |
+
<th>Falcon 3-3B Instruct</th>
|
| 107 |
+
<th>Falcon 3-3B Instruct-GPTQ-Int4</th>
|
| 108 |
+
<th>Falcon 3-3B Instruct-GPTQ-Int8</th>
|
| 109 |
+
<th>Falcon 3-3B Instruct-AWQ</th>
|
| 110 |
+
</tr>
|
| 111 |
+
</thead>
|
| 112 |
+
<tbody>
|
| 113 |
+
<tr>
|
| 114 |
+
<td>MMLU</td>
|
| 115 |
+
<td>55.7</td>
|
| 116 |
+
<td>53.25</td>
|
| 117 |
+
<td>55.79</td>
|
| 118 |
+
<td>53.3</td>
|
| 119 |
+
</tr>
|
| 120 |
+
<tr>
|
| 121 |
+
<td>MMLU-PRO</td>
|
| 122 |
+
<td>30.0</td>
|
| 123 |
+
<td>25.88</td>
|
| 124 |
+
<td>30.27</td>
|
| 125 |
+
<td>28.37</td>
|
| 126 |
+
</tr>
|
| 127 |
+
<tr>
|
| 128 |
+
<td>IFEval</td>
|
| 129 |
+
<td>69.07</td>
|
| 130 |
+
<td>62.83</td>
|
| 131 |
+
<td>68.34</td>
|
| 132 |
+
<td>67.85</td>
|
| 133 |
+
</tr>
|
| 134 |
+
</tbody>
|
| 135 |
+
</table>
|
| 136 |
+
|
| 137 |
+
## Useful links
|
| 138 |
+
- View our [release blogpost](https://huggingface.co/blog/falcon3).
|
| 139 |
+
- Feel free to join [our discord server](https://discord.gg/fwXpMyGc) if you have any questions or to interact with our researchers and developers.
|
| 140 |
+
|
| 141 |
+
## Technical Report
|
| 142 |
+
Coming soon....
|
| 143 |
+
|
| 144 |
+
## Citation
|
| 145 |
+
If the Falcon3 family of models were helpful to your work, feel free to give us a cite.
|
| 146 |
+
|
| 147 |
+
```
|
| 148 |
+
@misc{Falcon3,
|
| 149 |
+
title = {The Falcon 3 Family of Open Models},
|
| 150 |
+
url = {https://huggingface.co/blog/falcon3},
|
| 151 |
+
author = {Falcon-LLM Team},
|
| 152 |
+
month = {December},
|
| 153 |
+
year = {2024}
|
| 154 |
+
}
|
| 155 |
+
```
|
config.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"LlamaForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_bias": false,
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"eos_token_id": 11,
|
| 8 |
+
"head_dim": 256,
|
| 9 |
+
"hidden_act": "silu",
|
| 10 |
+
"hidden_size": 3072,
|
| 11 |
+
"initializer_range": 0.02,
|
| 12 |
+
"intermediate_size": 9216,
|
| 13 |
+
"max_position_embeddings": 32768,
|
| 14 |
+
"mlp_bias": false,
|
| 15 |
+
"model_type": "llama",
|
| 16 |
+
"num_attention_heads": 12,
|
| 17 |
+
"num_hidden_layers": 22,
|
| 18 |
+
"num_key_value_heads": 4,
|
| 19 |
+
"output_hidden_states": true,
|
| 20 |
+
"pretraining_tp": 1,
|
| 21 |
+
"quantization_config": {
|
| 22 |
+
"bits": 4,
|
| 23 |
+
"group_size": 128,
|
| 24 |
+
"modules_to_not_convert": null,
|
| 25 |
+
"quant_method": "awq",
|
| 26 |
+
"version": "gemm",
|
| 27 |
+
"zero_point": true
|
| 28 |
+
},
|
| 29 |
+
"rms_norm_eps": 1e-06,
|
| 30 |
+
"rope_scaling": null,
|
| 31 |
+
"rope_theta": 1000042,
|
| 32 |
+
"tie_word_embeddings": false,
|
| 33 |
+
"torch_dtype": "float16",
|
| 34 |
+
"transformers_version": "4.47.0",
|
| 35 |
+
"use_cache": false,
|
| 36 |
+
"vocab_size": 131072
|
| 37 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 11,
|
| 4 |
+
"do_sample": true,
|
| 5 |
+
"eos_token_id": 11,
|
| 6 |
+
"transformers_version": "4.47.0"
|
| 7 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f459ccd0fa8a80cf8e99dbef21205fce3e364f82665e6789f254ead0b682419c
|
| 3 |
+
size 2869360568
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"additional_special_tokens": [
|
| 3 |
+
">>TITLE<<",
|
| 4 |
+
">>ABSTRACT<<",
|
| 5 |
+
">>INTRODUCTION<<",
|
| 6 |
+
">>SUMMARY<<",
|
| 7 |
+
">>COMMENT<<",
|
| 8 |
+
">>ANSWER<<",
|
| 9 |
+
">>QUESTION<<",
|
| 10 |
+
">>DOMAIN<<",
|
| 11 |
+
">>EMAIL_ADDRESS<<",
|
| 12 |
+
">>IP_ADDRESS<<",
|
| 13 |
+
"<|startoftext|>",
|
| 14 |
+
">>IP_ADDRESS_0<<",
|
| 15 |
+
">>IP_ADDRESS_1<<",
|
| 16 |
+
">>IP_ADDRESS_2<<",
|
| 17 |
+
">>IP_ADDRESS_3<<",
|
| 18 |
+
">>IP_ADDRESS_4<<",
|
| 19 |
+
">>IP_ADDRESS_5<<",
|
| 20 |
+
">>IP_ADDRESS_6<<",
|
| 21 |
+
">>IP_ADDRESS_7<<",
|
| 22 |
+
">>IP_ADDRESS_8<<",
|
| 23 |
+
">>IP_ADDRESS_9<<",
|
| 24 |
+
">>PASSWORD<<",
|
| 25 |
+
">>KEY<<"
|
| 26 |
+
],
|
| 27 |
+
"eos_token": {
|
| 28 |
+
"content": "<|endoftext|>",
|
| 29 |
+
"lstrip": false,
|
| 30 |
+
"normalized": false,
|
| 31 |
+
"rstrip": false,
|
| 32 |
+
"single_word": false
|
| 33 |
+
},
|
| 34 |
+
"pad_token": {
|
| 35 |
+
"content": "<|pad|>",
|
| 36 |
+
"lstrip": false,
|
| 37 |
+
"normalized": false,
|
| 38 |
+
"rstrip": false,
|
| 39 |
+
"single_word": false
|
| 40 |
+
}
|
| 41 |
+
}
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|