Prince-1 commited on
Commit
bac407d
·
verified ·
1 Parent(s): 03c3df3

Add files using upload-large-folder tool

Browse files
Files changed (8) hide show
  1. .gitattributes +1 -0
  2. ConvertOnnx.py +32 -0
  3. README.md +230 -0
  4. genai_config.json +50 -0
  5. model.onnx +3 -0
  6. model.onnx.data +3 -0
  7. tokenizer.json +0 -0
  8. tokenizer_config.json +34 -0
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* 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
 
 
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
36
+ model.onnx.data filter=lfs diff=lfs merge=lfs -text
ConvertOnnx.py ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # /// script
2
+ # requires-python = ">=3.12"
3
+ # dependencies = [
4
+ # "onnx-ir",
5
+ # "onnxruntime-genai",
6
+ # "torch",
7
+ # "tqdm>=4.67.1",
8
+ # "transformers>=5.0.0",
9
+ # ]
10
+ # optional-dependencies = { cuda = [
11
+ # "torch==2.2.*+cu121",
12
+ # "onnxruntime-genai-cuda",
13
+ # ] }
14
+ # ///
15
+ from onnxruntime_genai.models.builder import create_model
16
+ import os
17
+ choices=["int4", "bf16", "fp16", "fp32"]
18
+ choices=["cpu", "cuda", "dml", "webgpu", "NvTensorRtRtx"]
19
+
20
+ from huggingface_hub import snapshot_download
21
+ model_path = snapshot_download("tiiuae/Falcon3-7B-Base",local_dir="/teamspace/studios/this_studio/model")
22
+
23
+ create_model(model_name=model_path,
24
+ input_path=model_path,
25
+ output_dir="onnx",
26
+ precision="fp16",
27
+ execution_provider="cpu",
28
+ cache_dir=os.path.join(os.getcwd(), "model_cache"),
29
+ extra_options={ "hf_token": os.getenv("hf", "true")})
30
+
31
+
32
+
README.md ADDED
@@ -0,0 +1,230 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ - fr
5
+ - es
6
+ - pt
7
+ tags:
8
+ - falcon3
9
+ - onnx
10
+ - onnxruntime-genai
11
+ license: other
12
+ license_name: falcon-llm-license
13
+ license_link: https://falconllm.tii.ae/falcon-terms-and-conditions.html
14
+ library_name: onnxruntime-genai
15
+ base_model:
16
+ - tiiuae/Falcon3-7B-Base
17
+ ---
18
+
19
+ <div align="center">
20
+ <img src="https://huggingface.co/datasets/tiiuae/documentation-images/resolve/main/general/falco3-logo.png" alt="drawing" width="500"/>
21
+ </div>
22
+
23
+ # Falcon3-7B-Base
24
+
25
+ **Falcon3** family of Open Foundation Models is a set of pretrained and instruct LLMs ranging from 1B to 10B.
26
+
27
+ This repository contains the **Falcon3-7B-Base**. It achieves state of art results (at the time of release) on reasoning, language understanding, instruction following, code and mathematics tasks.
28
+ Falcon3-7B-Base supports 4 languages (english, french, spanish, portuguese) and a context length up to 32K.
29
+
30
+ ⚠️ **This is a raw, pretrained model, which should be further finetuned for most usecases.**
31
+
32
+ ## Model Details
33
+ - Architecture
34
+ - transformer based causal decoder only architecture
35
+ - 28 decoder blocks
36
+ - grouped query attention (GQA) for faster inference: 12 query heads and 4 KV heads
37
+ - wider head dimension: 256
38
+ - high RoPE value to support long context understanding: 1000042
39
+ - 32k context length
40
+ - 131k vocab size
41
+ - Pretrained on 14 Teratokens of datasets comprising of web, code, STEM, high quality and mutlilingual data using 1024 H100 GPU chips
42
+ - Supports EN, FR, ES, PT
43
+ - Developed by [Technology Innovation Institute](https://www.tii.ae)
44
+ - License: TII Falcon-LLM License 2.0
45
+ - Model Release Date: December 2024
46
+
47
+
48
+ ## Getting started
49
+
50
+ <details>
51
+ <summary> Click to expand </summary>
52
+
53
+ ```python
54
+ import torch
55
+ from transformers import pipeline
56
+
57
+ pipe = pipeline(
58
+ "text-generation",
59
+ model="tiiuae/Falcon3-7B-Base",
60
+ torch_dtype=torch.bfloat16,
61
+ device_map="auto"
62
+ )
63
+ response = pipe("Question: How many hours in one day? Answer: ")
64
+ print(response[0]['generated_text'])
65
+ ```
66
+
67
+ </details>
68
+
69
+ <br>
70
+
71
+ ## Benchmarks
72
+ We report in the following table our internal pipeline benchmarks.
73
+ - We use [lm-evaluation harness](https://github.com/EleutherAI/lm-evaluation-harness).
74
+ - We report **raw scores**.
75
+ - We use same batch-size across all models.
76
+
77
+
78
+
79
+ <table border="1" style="width: 100%; text-align: center; border-collapse: collapse;">
80
+ <colgroup>
81
+ <col style="width: 10%;">
82
+ <col style="width: 10%;">
83
+ <col style="width: 7%;">
84
+ <col style="width: 7%;">
85
+ <col style="width: 7%;">
86
+ <col style="width: 7%;">
87
+ <col style="background-color: rgba(80, 15, 213, 0.5); width: 7%;">
88
+ </colgroup>
89
+ <thead>
90
+ <tr>
91
+ <th>Category</th>
92
+ <th>Benchmark</th>
93
+ <th>Llama3.1-8B</th>
94
+ <th>Qwen2-7B</th>
95
+ <th>Qwen2.5-7B</th>
96
+ <th>gemma-2-9b</th>
97
+ <th>Falcon3-7B-Base</th>
98
+ </tr>
99
+ </thead>
100
+ <tbody>
101
+ <tr>
102
+ <td rowspan="3">General</td>
103
+ <td>MMLU (5-shot)</td>
104
+ <td>65.2</td>
105
+ <td>70.4</td>
106
+ <td>74.2</td>
107
+ <td>-</td>
108
+ <td>67.5</td>
109
+ </tr>
110
+ <tr>
111
+ <td>MMLU-PRO (5-shot)</td>
112
+ <td>32.7</td>
113
+ <td>42.1</td>
114
+ <td>43.5</td>
115
+ <td>-</td>
116
+ <td>39.2</td>
117
+ </tr>
118
+ <tr>
119
+ <td>IFEval</td>
120
+ <td>12.0</td>
121
+ <td>30.6</td>
122
+ <td>33.9</td>
123
+ <td>-</td>
124
+ <td>34.3</td>
125
+ </tr>
126
+ <tr>
127
+ <td rowspan="2">Math</td>
128
+ <td>GSM8K (5-shot)</td>
129
+ <td>49.4</td>
130
+ <td>77.9</td>
131
+ <td>82.9</td>
132
+ <td>-</td>
133
+ <td>76.2</td>
134
+ </tr>
135
+ <tr>
136
+ <td>MATH(4-shot)</td>
137
+ <td>4.1</td>
138
+ <td>17.5</td>
139
+ <td>15.5</td>
140
+ <td>-</td>
141
+ <td>18.0</td>
142
+ </tr>
143
+ <tr>
144
+ <td rowspan="4">Reasoning</td>
145
+ <td>Arc Challenge (25-shot)</td>
146
+ <td>53.4</td>
147
+ <td>57.4</td>
148
+ <td>59.0</td>
149
+ <td>-</td>
150
+ <td>59.6</td>
151
+ </tr>
152
+ <tr>
153
+ <td>GPQA (0-shot)</td>
154
+ <td>31.0</td>
155
+ <td>31.9</td>
156
+ <td>33.0</td>
157
+ <td>-</td>
158
+ <td>35.5</td>
159
+ </tr>
160
+ <tr>
161
+ <td>MUSR (0-shot)</td>
162
+ <td>38.0</td>
163
+ <td>44.1</td>
164
+ <td>44.2</td>
165
+ <td>-</td>
166
+ <td>47.3</td>
167
+ </tr>
168
+ <tr>
169
+ <td>BBH (3-shot)</td>
170
+ <td>46.5</td>
171
+ <td>53.3</td>
172
+ <td>54.0</td>
173
+ <td>-</td>
174
+ <td>51.0</td>
175
+ </tr>
176
+ <tr>
177
+ <td rowspan="4">CommonSense Understanding</td>
178
+ <td>PIQA (0-shot)</td>
179
+ <td>80.3</td>
180
+ <td>79.8</td>
181
+ <td>78.7</td>
182
+ <td>-</td>
183
+ <td>77.7</td>
184
+ </tr>
185
+ <tr>
186
+ <td>SciQ (0-shot)</td>
187
+ <td>96.3</td>
188
+ <td>95.9</td>
189
+ <td>96.6</td>
190
+ <td>-</td>
191
+ <td>95.3</td>
192
+ </tr>
193
+ <tr>
194
+ <td>Winogrande (0-shot)</td>
195
+ <td>74.0</td>
196
+ <td>72.1</td>
197
+ <td>72.9</td>
198
+ <td>-</td>
199
+ <td>71.0</td>
200
+ </tr>
201
+ <tr>
202
+ <td>OpenbookQA (0-shot)</td>
203
+ <td>33.4</td>
204
+ <td>35.2</td>
205
+ <td>33.6</td>
206
+ <td>-</td>
207
+ <td>31.4</td>
208
+ </tr>
209
+ </tbody>
210
+ </table>
211
+
212
+ ## Useful links
213
+ - View our [release blogpost](https://huggingface.co/blog/falcon3).
214
+ - Feel free to join [our discord server](https://discord.gg/fwXpMyGc) if you have any questions or to interact with our researchers and developers.
215
+
216
+ ## Technical Report
217
+
218
+ Coming soon....
219
+
220
+ ## Citation
221
+ If Falcon3 family were helpful to your work, feel free to give us a cite.
222
+
223
+ ```
224
+ @misc{Falcon3,
225
+ title = {Falcon 3 family of Open Foundation Models},
226
+ author = {TII Team},
227
+ month = {December},
228
+ year = {2024}
229
+ }
230
+ ```
genai_config.json ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model": {
3
+ "bos_token_id": 11,
4
+ "context_length": 32768,
5
+ "decoder": {
6
+ "session_options": {
7
+ "log_id": "onnxruntime-genai",
8
+ "provider_options": []
9
+ },
10
+ "filename": "model.onnx",
11
+ "head_size": 256,
12
+ "hidden_size": 3072,
13
+ "inputs": {
14
+ "input_ids": "input_ids",
15
+ "attention_mask": "attention_mask",
16
+ "position_ids": "position_ids",
17
+ "past_key_names": "past_key_values.%d.key",
18
+ "past_value_names": "past_key_values.%d.value"
19
+ },
20
+ "outputs": {
21
+ "logits": "logits",
22
+ "present_key_names": "present.%d.key",
23
+ "present_value_names": "present.%d.value"
24
+ },
25
+ "num_attention_heads": 12,
26
+ "num_hidden_layers": 28,
27
+ "num_key_value_heads": 4
28
+ },
29
+ "eos_token_id": 11,
30
+ "pad_token_id": 11,
31
+ "type": "llama",
32
+ "vocab_size": 131072
33
+ },
34
+ "search": {
35
+ "diversity_penalty": 0.0,
36
+ "do_sample": null,
37
+ "early_stopping": true,
38
+ "length_penalty": 1.0,
39
+ "max_length": 32768,
40
+ "min_length": 0,
41
+ "no_repeat_ngram_size": 0,
42
+ "num_beams": 1,
43
+ "num_return_sequences": 1,
44
+ "past_present_share_buffer": false,
45
+ "repetition_penalty": 1.0,
46
+ "temperature": null,
47
+ "top_k": null,
48
+ "top_p": null
49
+ }
50
+ }
model.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5c0aec238f20910c50a3109345c38fb3a232f847ec2a9f4b427e2c6e9e76a7a9
3
+ size 656606
model.onnx.data ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8e82bab3cb51ded6663ee418f2ac5e69775745521a7db8af152ffe55dd4d4453
3
+ size 14927921152
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "backend": "tokenizers",
4
+ "clean_up_tokenization_spaces": true,
5
+ "eos_token": "<|endoftext|>",
6
+ "extra_special_tokens": [
7
+ ">>TITLE<<",
8
+ ">>ABSTRACT<<",
9
+ ">>INTRODUCTION<<",
10
+ ">>SUMMARY<<",
11
+ ">>COMMENT<<",
12
+ ">>ANSWER<<",
13
+ ">>QUESTION<<",
14
+ ">>DOMAIN<<",
15
+ ">>EMAIL_ADDRESS<<",
16
+ ">>IP_ADDRESS<<",
17
+ "<|startoftext|>",
18
+ ">>IP_ADDRESS_0<<",
19
+ ">>IP_ADDRESS_1<<",
20
+ ">>IP_ADDRESS_2<<",
21
+ ">>IP_ADDRESS_3<<",
22
+ ">>IP_ADDRESS_4<<",
23
+ ">>IP_ADDRESS_5<<",
24
+ ">>IP_ADDRESS_6<<",
25
+ ">>IP_ADDRESS_7<<",
26
+ ">>IP_ADDRESS_8<<",
27
+ ">>IP_ADDRESS_9<<",
28
+ ">>PASSWORD<<",
29
+ ">>KEY<<"
30
+ ],
31
+ "is_local": true,
32
+ "model_max_length": 32768,
33
+ "tokenizer_class": "TokenizersBackend"
34
+ }