TouchNight commited on
Commit
f3663ac
1 Parent(s): dcd82ea

Upload 10 files

Browse files
.gitattributes CHANGED
@@ -33,3 +33,5 @@ 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
+ tekken.json filter=lfs diff=lfs merge=lfs -text
37
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -1,5 +1,495 @@
1
- ---
2
- license: other
3
- license_name: mrl
4
- license_link: https://mistral.ai/licenses/MRL-0.1.md
5
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ - fr
5
+ - de
6
+ - es
7
+ - it
8
+ - pt
9
+ - zh
10
+ - ja
11
+ - ru
12
+ - ko
13
+ license: other
14
+ license_name: mrl
15
+ inference: false
16
+ license_link: https://mistral.ai/licenses/MRL-0.1.md
17
+ extra_gated_prompt: >-
18
+ # Mistral AI Research License
19
+
20
+ If You want to use a Mistral Model, a Derivative or an Output for any purpose that is not expressly authorized under this Agreement, You must request a license from Mistral AI, which Mistral AI may grant to You in Mistral AI's sole discretion. To discuss such a license, please contact Mistral AI via the website contact form: https://mistral.ai/contact/
21
+
22
+ ## 1. Scope and acceptance
23
+
24
+ **1.1. Scope of the Agreement.** This Agreement applies to any use, modification, or Distribution of any Mistral Model by You, regardless of the source You obtained a copy of such Mistral Model.
25
+
26
+ **1.2. Acceptance.** By accessing, using, modifying, Distributing a Mistral Model, or by creating, using or distributing a Derivative of the Mistral Model, You agree to be bound by this Agreement.
27
+
28
+ **1.3. Acceptance on behalf of a third-party.** If You accept this Agreement on behalf of Your employer or another person or entity, You warrant and represent that You have the authority to act and accept this Agreement on their behalf. In such a case, the word "You" in this Agreement will refer to Your employer or such other person or entity.
29
+
30
+ ## 2. License
31
+
32
+ **2.1. Grant of rights**. Subject to Section 3 below, Mistral AI hereby grants You a non-exclusive, royalty-free, worldwide, non-sublicensable, non-transferable, limited license to use, copy, modify, and Distribute under the conditions provided in Section 2.2 below, the Mistral Model and any Derivatives made by or for Mistral AI and to create Derivatives of the Mistral Model.
33
+
34
+ **2.2. Distribution of Mistral Model and Derivatives made by or for Mistral AI.** Subject to Section 3 below, You may Distribute copies of the Mistral Model and/or Derivatives made by or for Mistral AI, under the following conditions:
35
+ You must make available a copy of this Agreement to third-party recipients of the Mistral Models and/or Derivatives made by or for Mistral AI you Distribute, it being specified that any rights to use the Mistral Models and/or Derivatives made by or for Mistral AI shall be directly granted by Mistral AI to said third-party recipients pursuant to the Mistral AI Research License agreement executed between these parties;
36
+ You must retain in all copies of the Mistral Models the following attribution notice within a "Notice" text file distributed as part of such copies: "Licensed by Mistral AI under the Mistral AI Research License".
37
+
38
+ **2.3. Distribution of Derivatives made by or for You.** Subject to Section 3 below, You may Distribute any Derivatives made by or for You under additional or different terms and conditions, provided that:
39
+ In any event, the use and modification of Mistral Model and/or Derivatives made by or for Mistral AI shall remain governed by the terms and conditions of this Agreement;
40
+ You include in any such Derivatives made by or for You prominent notices stating that You modified the concerned Mistral Model; and
41
+ Any terms and conditions You impose on any third-party recipients relating to Derivatives made by or for You shall neither limit such third-party recipients' use of the Mistral Model or any Derivatives made by or for Mistral AI in accordance with the Mistral AI Research License nor conflict with any of its terms and conditions.
42
+
43
+ ## 3. Limitations
44
+
45
+ **3.1. Misrepresentation.** You must not misrepresent or imply, through any means, that the Derivatives made by or for You and/or any modified version of the Mistral Model You Distribute under your name and responsibility is an official product of Mistral AI or has been endorsed, approved or validated by Mistral AI, unless You are authorized by Us to do so in writing.
46
+
47
+ **3.2. Usage Limitation.** You shall only use the Mistral Models, Derivatives (whether or not created by Mistral AI) and Outputs for Research Purposes.
48
+
49
+ ## 4. Intellectual Property
50
+
51
+ **4.1. Trademarks.** No trademark licenses are granted under this Agreement, and in connection with the Mistral Models, You may not use any name or mark owned by or associated with Mistral AI or any of its affiliates, except (i) as required for reasonable and customary use in describing and Distributing the Mistral Models and Derivatives made by or for Mistral AI and (ii) for attribution purposes as required by this Agreement.
52
+
53
+ **4.2. Outputs.** We claim no ownership rights in and to the Outputs. You are solely responsible for the Outputs You generate and their subsequent uses in accordance with this Agreement. Any Outputs shall be subject to the restrictions set out in Section 3 of this Agreement.
54
+
55
+ **4.3. Derivatives.** By entering into this Agreement, You accept that any Derivatives that You may create or that may be created for You shall be subject to the restrictions set out in Section 3 of this Agreement.
56
+
57
+ ## 5. Liability
58
+
59
+ **5.1. Limitation of liability.** In no event, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall Mistral AI be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this Agreement or out of the use or inability to use the Mistral Models and Derivatives (including but not limited to damages for loss of data, loss of goodwill, loss of expected profit or savings, work stoppage, computer failure or malfunction, or any damage caused by malware or security breaches), even if Mistral AI has been advised of the possibility of such damages.
60
+
61
+ **5.2. Indemnification.** You agree to indemnify and hold harmless Mistral AI from and against any claims, damages, or losses arising out of or related to Your use or Distribution of the Mistral Models and Derivatives.
62
+
63
+ ## 6. Warranty
64
+
65
+ **6.1. Disclaimer.** Unless required by applicable law or prior agreed to by Mistral AI in writing, Mistral AI provides the Mistral Models and Derivatives on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. Mistral AI does not represent nor warrant that the Mistral Models and Derivatives will be error-free, meet Your or any third party's requirements, be secure or will allow You or any third party to achieve any kind of result or generate any kind of content. You are solely responsible for determining the appropriateness of using or Distributing the Mistral Models and Derivatives and assume any risks associated with Your exercise of rights under this Agreement.
66
+
67
+ ## 7. Termination
68
+
69
+ **7.1. Term.** This Agreement is effective as of the date of your acceptance of this Agreement or access to the concerned Mistral Models or Derivatives and will continue until terminated in accordance with the following terms.
70
+
71
+ **7.2. Termination.** Mistral AI may terminate this Agreement at any time if You are in breach of this Agreement. Upon termination of this Agreement, You must cease to use all Mistral Models and Derivatives and shall permanently delete any copy thereof. The following provisions, in their relevant parts, will survive any termination or expiration of this Agreement, each for the duration necessary to achieve its own intended purpose (e.g. the liability provision will survive until the end of the applicable limitation period):Sections 5 (Liability), 6(Warranty), 7 (Termination) and 8 (General Provisions).
72
+
73
+ **7.3. Litigation.** If You initiate any legal action or proceedings against Us or any other entity (including a cross-claim or counterclaim in a lawsuit), alleging that the Model or a Derivative, or any part thereof, infringe upon intellectual property or other rights owned or licensable by You, then any licenses granted to You under this Agreement will immediately terminate as of the date such legal action or claim is filed or initiated.
74
+
75
+ ## 8. General provisions
76
+
77
+ **8.1. Governing laws.** This Agreement will be governed by the laws of France, without regard to choice of law principles, and the UN Convention on Contracts for the International Sale of Goods does not apply to this Agreement.
78
+
79
+ **8.2. Competent jurisdiction.** The courts of Paris shall have exclusive jurisdiction of any dispute arising out of this Agreement.
80
+
81
+ **8.3. Severability.** If any provision of this Agreement is held to be invalid, illegal or unenforceable, the remaining provisions shall be unaffected thereby and remain valid as if such provision had not been set forth herein.
82
+
83
+ ## 9. Definitions
84
+
85
+ "Agreement": means this Mistral AI Research License agreement governing the access, use, and Distribution of the Mistral Models, Derivatives and Outputs.
86
+
87
+ "Derivative": means any (i) modified version of the Mistral Model (including but not limited to any customized or fine-tuned version thereof), (ii) work based on the Mistral Model, or (iii) any other derivative work thereof.
88
+
89
+ "Distribution", "Distributing", "Distribute" or "Distributed": means supplying, providing or making available, by any means, a copy of the Mistral Models and/or the Derivatives as the case may be, subject to Section 3 of this Agreement.
90
+
91
+ "Mistral AI", "We" or "Us": means Mistral AI, a French société par actions simplifiée registered in the Paris commercial registry under the number 952 418 325, and having its registered seat at 15, rue des Halles, 75001 Paris.
92
+
93
+ "Mistral Model": means the foundational large language model(s), and its elements which include algorithms, software, instructed checkpoints, parameters, source code (inference code, evaluation code and, if applicable, fine-tuning code) and any other elements associated thereto made available by Mistral AI under this Agreement, including, if any, the technical documentation, manuals and instructions for the use and operation thereof.
94
+
95
+ "Research Purposes": means any use of a Mistral Model, Derivative, or Output that is solely for (a) personal, scientific or academic research, and (b) for non-profit and non-commercial purposes, and not directly or indirectly connected to any commercial activities or business operations. For illustration purposes, Research Purposes does not include (1) any usage of the Mistral Model, Derivative or Output by individuals or contractors employed in or engaged by companies in the context of (a) their daily tasks, or (b) any activity (including but not limited to any testing or proof-of-concept) that is intended to generate revenue, nor (2) any Distribution by a commercial entity of the Mistral Model, Derivative or Output whether in return for payment or free of charge, in any medium or form, including but not limited to through a hosted or managed service (e.g. SaaS, cloud instances, etc.), or behind a software layer.
96
+
97
+ "Outputs": means any content generated by the operation of the Mistral Models or the Derivatives from a prompt (i.e., text instructions) provided by users. For the avoidance of doubt, Outputs do not include any components of a Mistral Models, such as any fine-tuned versions of the Mistral Models, the weights, or parameters.
98
+
99
+ "You": means the individual or entity entering into this Agreement with Mistral AI.
100
+
101
+
102
+ *Mistral AI processes your personal data below to provide the model and enforce its license. If you are affiliated with a commercial entity, we may also send you communications about our models. For more information on your rights and data handling, please see our <a href="https://mistral.ai/terms/">privacy policy</a>.*
103
+ extra_gated_fields:
104
+ First Name: text
105
+ Last Name: text
106
+ Country: country
107
+ Affiliation: text
108
+ Job title: text
109
+ I understand that I can only use the model, any derivative versions and their outputs for non-commercial research purposes: checkbox
110
+ I understand that if I am a commercial entity, I am not permitted to use or distribute the model internally or externally, or expose it in my own offerings without a commercial license: checkbox
111
+ I understand that if I upload the model, or any derivative version, on any platform, I must include the Mistral Research License: checkbox
112
+ I understand that for commercial use of the model, I can contact Mistral or use the Mistral AI API on la Plateforme or any of our cloud provider partners: checkbox
113
+ ? By clicking Submit below I accept the terms of the license and acknowledge that
114
+ the information I provide will be collected stored processed and shared in accordance
115
+ with the Mistral Privacy Policy
116
+ : checkbox
117
+ geo: ip_location
118
+ extra_gated_description: >-
119
+ Mistral AI processes your personal data below to provide the model and enforce its license. If you are affiliated with a commercial entity, we may also send you communications about our models. For more information on your rights and data handling, please see our <a href="https://mistral.ai/terms/">privacy policy</a>.
120
+ extra_gated_button_content: Submit
121
+ library_name: vllm
122
+ ---
123
+
124
+ # Model Card for Ministral-8B-Instruct-2410
125
+
126
+ We introduce two new state-of-the-art models for local intelligence, on-device computing, and at-the-edge use cases. We call them les Ministraux: Ministral 3B and Ministral 8B.
127
+
128
+ The Ministral-8B-Instruct-2410 Language Model is an instruct fine-tuned model significantly outperforming existing models of similar size, released under the Mistral Research License.
129
+
130
+ If you are interested in using Ministral-3B or Ministral-8B commercially, outperforming Mistral-7B, [reach out to us](https://mistral.ai/contact/).
131
+
132
+ For more details about les Ministraux please refer to our release [blog post](https://mistral.ai/news/ministraux).
133
+
134
+ ## Ministral 8B Key features
135
+ - Released under the **Mistral Research License**, reach out to us for a commercial license
136
+ - Trained with a **128k context window** with **interleaved sliding-window attention**
137
+ - Trained on a large proportion of **multilingual and code data**
138
+ - Supports **function calling**
139
+ - Vocabulary size of **131k**, using the **V3-Tekken** tokenizer
140
+
141
+ ### Basic Instruct Template (V3-Tekken)
142
+
143
+ ```
144
+ <s>[INST]user message[/INST]assistant response</s>[INST]new user message[/INST]
145
+ ```
146
+
147
+ *For more information about the tokenizer please refer to [mistral-common](https://github.com/mistralai/mistral-common)*
148
+
149
+ ## Ministral 8B Architecture
150
+
151
+ | Feature | Value |
152
+ |:---------------------:|:--------------------:|
153
+ | **Architecture** | Dense Transformer |
154
+ | **Parameters** | 8,019,808,256 |
155
+ | **Layers** | 36 |
156
+ | **Heads** | 32 |
157
+ | **Dim** | 4096 |
158
+ | **KV Heads (GQA)** | 8 |
159
+ | **Hidden Dim** | 12288 |
160
+ | **Head Dim** | 128 |
161
+ | **Vocab Size** | 131,072 |
162
+ | **Context Length** | 128k |
163
+ | **Attention Pattern** | Ragged (128k,32k,32k,32k) |
164
+
165
+ ## Benchmarks
166
+
167
+ #### Base Models
168
+
169
+ <u>Knowledge & Commonsense</u>
170
+
171
+ | Model | MMLU | AGIEval | Winogrande | Arc-c | TriviaQA |
172
+ |:-------------:|:------:|:---------:|:------------:|:-------:|:----------:|
173
+ | Mistral 7B Base | 62.5 | 42.5 | 74.2 | 67.9 | 62.5 |
174
+ | Llama 3.1 8B Base | 64.7 | 44.4 | 74.6 | 46.0 | 60.2 |
175
+ | ***Ministral 8B Base*** | ***<u>65.0</u>*** | ***<u>48.3</u>*** | ***<u>75.3</u>*** | ***<u>71.9</u>*** | ***<u>65.5</u>*** |
176
+ | | | | | | |
177
+ | Gemma 2 2B Base | 52.4 | 33.8 | 68.7 | 42.6 | 47.8 |
178
+ | Llama 3.2 3B Base | 56.2 | 37.4 | 59.6 | 43.1 | 50.7 |
179
+ | ***Ministral 3B Base*** | ***<u>60.9</u>*** | ***<u>42.1</u>*** | ***<u>72.7</u>*** | ***<u>64.2</u>*** | ***<u>56.7</u>*** |
180
+
181
+ <u>Code & Math</u>
182
+
183
+ | Model | HumanEval pass@1 |GSM8K maj@8 |
184
+ |:-------------:|:-------------------:|:---------------:|
185
+ | Mistral 7B Base | 26.8 | 32.0 |
186
+ | Llama 3.1 8B Base | ***<u>37.8</u>*** | 42.2 |
187
+ | ***Ministral 8B Base*** | 34.8 | ***<u>64.5</u>*** |
188
+ | | | |
189
+ | Gemma 2 2B | 20.1 | 35.5 |
190
+ | Llama 3.2 3B | 14.6 | 33.5 |
191
+ | ***Ministral 3B*** | ***<u>34.2</u>*** | ***<u>50.9</u>*** |
192
+
193
+ <u>Multilingual</u>
194
+
195
+ | Model | French MMLU | German MMLU | Spanish MMLU |
196
+ |:-------------:|:-------------:|:-------------:|:-------------:|
197
+ | Mistral 7B Base | 50.6 | 49.6 | 51.4 |
198
+ | Llama 3.1 8B Base | 50.8 | 52.8 | 54.6 |
199
+ | ***Ministral 8B Base*** | ***<u>57.5</u>*** | ***<u>57.4</u>*** | ***<u>59.6</u>*** |
200
+ | | | | |
201
+ | Gemma 2 2B Base | 41.0 | 40.1 | 41.7 |
202
+ | Llama 3.2 3B Base | 42.3 | 42.2 | 43.1 |
203
+ | ***Ministral 3B Base*** | ***<u>49.1</u>*** | ***<u>48.3</u>*** | ***<u>49.5</u>*** |
204
+
205
+ ### Instruct Models
206
+
207
+ <u>Chat/Arena (gpt-4o judge)</u>
208
+
209
+ | Model | MTBench | Arena Hard | Wild bench |
210
+ |:-------------:|:---------:|:------------:|:------------:|
211
+ | Mistral 7B Instruct v0.3 | 6.7 | 44.3 | 33.1 |
212
+ | Llama 3.1 8B Instruct | 7.5 | 62.4 | 37.0 |
213
+ | Gemma 2 9B Instruct | 7.6 | 68.7 | ***<u>43.8</u>*** |
214
+ | ***Ministral 8B Instruct*** | ***<u>8.3</u>*** | ***<u>70.9</u>*** | 41.3 |
215
+ | | | | |
216
+ | Gemma 2 2B Instruct | 7.5 | 51.7 | 32.5 |
217
+ | Llama 3.2 3B Instruct | 7.2 | 46.0 | 27.2 |
218
+ | ***Ministral 3B Instruct*** | ***<u>8.1</u>*** | ***<u>64.3</u>*** | ***<u>36.3</u>*** |
219
+
220
+ <u>Code & Math</u>
221
+
222
+ | Model | MBPP pass@1 | HumanEval pass@1 | Math maj@1 |
223
+ |:-------------:|:-------------:|:------------------:|:-------------:|
224
+ | Mistral 7B Instruct v0.3 | 50.2 | 38.4 | 13.2 |
225
+ | Gemma 2 9B Instruct | 68.5 | 67.7 | 47.4 |
226
+ Llama 3.1 8B Instruct | 69.7 | 67.1 | 49.3 |
227
+ | ***Ministral 8B Instruct*** | ***<u>70.0</u>*** | ***<u>76.8</u>*** | ***<u>54.5</u>*** |
228
+ | | | | |
229
+ | Gemma 2 2B Instruct | 54.5 | 42.7 | 22.8 |
230
+ | Llama 3.2 3B Instruct | 64.6 | 61.0 | 38.4 |
231
+ | ***Ministral 3B* Instruct** | ***<u>67.7</u>*** | ***<u>77.4</u>*** | ***<u>51.7</u>*** |
232
+
233
+ <u>Function calling</u>
234
+
235
+ | Model | Internal bench |
236
+ |:-------------:|:-----------------:|
237
+ | Mistral 7B Instruct v0.3 | 6.9 |
238
+ | Llama 3.1 8B Instruct | N/A |
239
+ | Gemma 2 9B Instruct | N/A |
240
+ | ***Ministral 8B Instruct*** | ***<u>31.6</u>*** |
241
+ | | |
242
+ | Gemma 2 2B Instruct | N/A |
243
+ | Llama 3.2 3B Instruct | N/A |
244
+ | ***Ministral 3B Instruct*** | ***<u>28.4</u>*** |
245
+
246
+ ## Usage Examples
247
+
248
+ ### vLLM (recommended)
249
+
250
+ We recommend using this model with the [vLLM library](https://github.com/vllm-project/vllm)
251
+ to implement production-ready inference pipelines.
252
+
253
+ > [!IMPORTANT]
254
+ > Currently vLLM is capped at 32k context size because interleaved attention kernels for paged attention are not yet implemented in vLLM.
255
+ > Attention kernels for paged attention are being worked on and as soon as it is fully supported in vLLM, this model card will be updated.
256
+ > To take advantage of the full 128k context size we recommend [Mistral Inference](https://huggingface.co/mistralai/Ministral-8B-Instruct-2410#mistral-inference)
257
+
258
+ **_Installation_**
259
+
260
+
261
+ Make sure you install `vLLM >= v0.6.2`:
262
+
263
+ ```
264
+ pip install --upgrade vllm
265
+ ```
266
+
267
+ Also make sure you have `mistral_common >= 1.4.4` installed:
268
+
269
+ ```
270
+ pip install --upgrade mistral_common
271
+ ```
272
+
273
+ You can also make use of a ready-to-go [docker image](https://github.com/vllm-project/vllm/blob/main/Dockerfile).
274
+
275
+ **_Offline_**
276
+
277
+ ```py
278
+ from vllm import LLM
279
+ from vllm.sampling_params import SamplingParams
280
+
281
+ model_name = "mistralai/Ministral-8B-Instruct-2410"
282
+
283
+ sampling_params = SamplingParams(max_tokens=8192)
284
+
285
+ # note that running Ministral 8B on a single GPU requires 24 GB of GPU RAM
286
+ # If you want to divide the GPU requirement over multiple devices, please add *e.g.* `tensor_parallel=2`
287
+ llm = LLM(model=model_name, tokenizer_mode="mistral", config_format="mistral", load_format="mistral")
288
+
289
+ prompt = "Do we need to think for 10 seconds to find the answer of 1 + 1?"
290
+
291
+ messages = [
292
+ {
293
+ "role": "user",
294
+ "content": prompt
295
+ },
296
+ ]
297
+
298
+ outputs = llm.chat(messages, sampling_params=sampling_params)
299
+
300
+ print(outputs[0].outputs[0].text)
301
+ # You don't need to think for 10 seconds to find the answer to 1 + 1. The answer is 2,
302
+ # and you can easily add these two numbers in your mind very quickly without any delay.
303
+ ```
304
+
305
+ **_Server_**
306
+
307
+ You can also use Ministral-8B in a server/client setting.
308
+
309
+ 1. Spin up a server:
310
+
311
+
312
+ ```
313
+ vllm serve mistralai/Ministral-8B-Instruct-2410 --tokenizer_mode mistral --config_format mistral --load_format mistral
314
+ ```
315
+
316
+ **Note:** Running Ministral-8B on a single GPU requires 24 GB of GPU RAM.
317
+
318
+ If you want to divide the GPU requirement over multiple devices, please add *e.g.* `--tensor_parallel=2`
319
+
320
+ 2. And ping the client:
321
+
322
+ ```
323
+ curl --location 'http://<your-node-url>:8000/v1/chat/completions' \
324
+ --header 'Content-Type: application/json' \
325
+ --header 'Authorization: Bearer token' \
326
+ --data '{
327
+ "model": "mistralai/Ministral-8B-Instruct-2410",
328
+ "messages": [
329
+ {
330
+ "role": "user",
331
+ "content": "Do we need to think for 10 seconds to find the answer of 1 + 1?"
332
+ }
333
+ ]
334
+ }'
335
+
336
+ ```
337
+
338
+ ### Mistral-inference
339
+
340
+ We recommend using [mistral-inference](https://github.com/mistralai/mistral-inference) to quickly try out / "vibe-check" the model.
341
+
342
+
343
+ **_Install_**
344
+
345
+ Make sure to have `mistral_inference >= 1.5.0` installed.
346
+
347
+ ```
348
+ pip install mistral_inference --upgrade
349
+ ```
350
+
351
+ **_Download_**
352
+
353
+ ```py
354
+ from huggingface_hub import snapshot_download
355
+ from pathlib import Path
356
+
357
+ mistral_models_path = Path.home().joinpath('mistral_models', '8B-Instruct')
358
+ mistral_models_path.mkdir(parents=True, exist_ok=True)
359
+
360
+ snapshot_download(repo_id="mistralai/Ministral-8B-Instruct-2410", allow_patterns=["params.json", "consolidated.safetensors", "tekken.json"], local_dir=mistral_models_path)
361
+ ```
362
+
363
+ ### Chat
364
+
365
+ After installing `mistral_inference`, a `mistral-chat` CLI command should be available in your environment. You can chat with the model using
366
+
367
+ ```
368
+ mistral-chat $HOME/mistral_models/8B-Instruct --instruct --max_tokens 256
369
+ ```
370
+
371
+ ### Passkey detection
372
+
373
+ > [!IMPORTANT]
374
+ > In this example the passkey message has over >100k tokens and mistral-inference
375
+ > does not have a chunked pre-fill mechanism. Therefore you will need a lot of
376
+ > GPU memory in order to run the below example (80 GB). For a more memory-efficient
377
+ > solution we recommend using vLLM.
378
+
379
+ ```py
380
+ from mistral_inference.transformer import Transformer
381
+ from pathlib import Path
382
+ import json
383
+ from mistral_inference.generate import generate
384
+ from huggingface_hub import hf_hub_download
385
+
386
+ from mistral_common.tokens.tokenizers.mistral import MistralTokenizer
387
+ from mistral_common.protocol.instruct.messages import UserMessage
388
+ from mistral_common.protocol.instruct.request import ChatCompletionRequest
389
+
390
+ def load_passkey_request() -> ChatCompletionRequest:
391
+ passkey_file = hf_hub_download(repo_id="mistralai/Ministral-8B-Instruct-2410", filename="passkey_example.json")
392
+
393
+ with open(passkey_file, "r") as f:
394
+ data = json.load(f)
395
+
396
+ message_content = data["messages"][0]["content"]
397
+ return ChatCompletionRequest(messages=[UserMessage(content=message_content)])
398
+
399
+ tokenizer = MistralTokenizer.from_file(f"{mistral_models_path}/tekken.json")
400
+ model = Transformer.from_folder(mistral_models_path, softmax_fp32=False)
401
+
402
+ completion_request = load_passkey_request()
403
+
404
+ tokens = tokenizer.encode_chat_completion(completion_request).tokens
405
+
406
+ out_tokens, _ = generate([tokens], model, max_tokens=64, temperature=0.0, eos_id=tokenizer.instruct_tokenizer.tokenizer.eos_id)
407
+ result = tokenizer.instruct_tokenizer.tokenizer.decode(out_tokens[0])
408
+
409
+ print(result) # The pass key is 13005.
410
+ ```
411
+
412
+
413
+ ### Instruct following
414
+
415
+ ```py
416
+ from mistral_inference.transformer import Transformer
417
+ from mistral_inference.generate import generate
418
+
419
+ from mistral_common.tokens.tokenizers.mistral import MistralTokenizer
420
+ from mistral_common.protocol.instruct.messages import UserMessage
421
+ from mistral_common.protocol.instruct.request import ChatCompletionRequest
422
+
423
+
424
+ tokenizer = MistralTokenizer.from_file(f"{mistral_models_path}/tekken.json")
425
+ model = Transformer.from_folder(mistral_models_path)
426
+
427
+ completion_request = ChatCompletionRequest(messages=[UserMessage(content="How often does the letter r occur in Mistral?")])
428
+
429
+ tokens = tokenizer.encode_chat_completion(completion_request).tokens
430
+
431
+ out_tokens, _ = generate([tokens], model, max_tokens=64, temperature=0.0, eos_id=tokenizer.instruct_tokenizer.tokenizer.eos_id)
432
+ result = tokenizer.instruct_tokenizer.tokenizer.decode(out_tokens[0])
433
+
434
+ print(result)
435
+ ```
436
+
437
+ ### Function calling
438
+
439
+ ```py
440
+ from mistral_common.protocol.instruct.tool_calls import Function, Tool
441
+ from mistral_inference.transformer import Transformer
442
+ from mistral_inference.generate import generate
443
+
444
+ from mistral_common.tokens.tokenizers.mistral import MistralTokenizer
445
+ from mistral_common.protocol.instruct.messages import UserMessage
446
+ from mistral_common.protocol.instruct.request import ChatCompletionRequest
447
+ from mistral_common.tokens.tokenizers.tekken import SpecialTokenPolicy
448
+
449
+
450
+ tokenizer = MistralTokenizer.from_file(f"{mistral_models_path}/tekken.json")
451
+ tekken = tokenizer.instruct_tokenizer.tokenizer
452
+ tekken.special_token_policy = SpecialTokenPolicy.IGNORE
453
+
454
+ model = Transformer.from_folder(mistral_models_path)
455
+
456
+ completion_request = ChatCompletionRequest(
457
+ tools=[
458
+ Tool(
459
+ function=Function(
460
+ name="get_current_weather",
461
+ description="Get the current weather",
462
+ parameters={
463
+ "type": "object",
464
+ "properties": {
465
+ "location": {
466
+ "type": "string",
467
+ "description": "The city and state, e.g. San Francisco, CA",
468
+ },
469
+ "format": {
470
+ "type": "string",
471
+ "enum": ["celsius", "fahrenheit"],
472
+ "description": "The temperature unit to use. Infer this from the users location.",
473
+ },
474
+ },
475
+ "required": ["location", "format"],
476
+ },
477
+ )
478
+ )
479
+ ],
480
+ messages=[
481
+ UserMessage(content="What's the weather like today in Paris?"),
482
+ ],
483
+ )
484
+
485
+ tokens = tokenizer.encode_chat_completion(completion_request).tokens
486
+
487
+ out_tokens, _ = generate([tokens], model, max_tokens=64, temperature=0.0, eos_id=tokenizer.instruct_tokenizer.tokenizer.eos_id)
488
+ result = tokenizer.instruct_tokenizer.tokenizer.decode(out_tokens[0])
489
+
490
+ print(result)
491
+ ```
492
+
493
+ ## The Mistral AI Team
494
+
495
+ Albert Jiang, Alexandre Abou Chahine, Alexandre Sablayrolles, Alexis Tacnet, Alodie Boissonnet, Alok Kothari, Amélie Héliou, Andy Lo, Anna Peronnin, Antoine Meunier, Antoine Roux, Antonin Faure, Aritra Paul, Arthur Darcet, Arthur Mensch, Audrey Herblin-Stoop, Augustin Garreau, Austin Birky, Avinash Sooriyarachchi, Baptiste Rozière, Barry Conklin, Bastien Bouillon, Blanche Savary de Beauregard, Carole Rambaud, Caroline Feldman, Charles de Freminville, Charline Mauro, Chih-Kuan Yeh, Chris Bamford, Clement Auguy, Corentin Heintz, Cyriaque Dubois, Devendra Singh Chaplot, Diego Las Casas, Diogo Costa, Eléonore Arcelin, Emma Bou Hanna, Etienne Metzger, Fanny Olivier Autran, Francois Lesage, Garance Gourdel, Gaspard Blanchet, Gaspard Donada Vidal, Gianna Maria Lengyel, Guillaume Bour, Guillaume Lample, Gustave Denis, Harizo Rajaona, Himanshu Jaju, Ian Mack, Ian Mathew, Jean-Malo Delignon, Jeremy Facchetti, Jessica Chudnovsky, Joachim Studnia, Justus Murke, Kartik Khandelwal, Kenneth Chiu, Kevin Riera, Leonard Blier, Leonard Suslian, Leonardo Deschaseaux, Louis Martin, Louis Ternon, Lucile Saulnier, Lélio Renard Lavaud, Sophia Yang, Margaret Jennings, Marie Pellat, Marie Torelli, Marjorie Janiewicz, Mathis Felardos, Maxime Darrin, Michael Hoff, Mickaël Seznec, Misha Jessel Kenyon, Nayef Derwiche, Nicolas Carmont Zaragoza, Nicolas Faurie, Nicolas Moreau, Nicolas Schuhl, Nikhil Raghuraman, Niklas Muhs, Olivier de Garrigues, Patricia Rozé, Patricia Wang, Patrick von Platen, Paul Jacob, Pauline Buche, Pavankumar Reddy Muddireddy, Perry Savas, Pierre Stock, Pravesh Agrawal, Renaud de Peretti, Romain Sauvestre, Romain Sinthe, Roman Soletskyi, Sagar Vaze, Sandeep Subramanian, Saurabh Garg, Soham Ghosh, Sylvain Regnier, Szymon Antoniak, Teven Le Scao, Theophile Gervet, Thibault Schueller, Thibaut Lavril, Thomas Wang, Timothée Lacroix, Valeriia Nemychnikova, Wendy Shang, William El Sayed, William Marshall
config.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "MistralForCausalLM"
4
+ ],
5
+ "attention_dropout": 0.0,
6
+ "bos_token_id": 1,
7
+ "eos_token_id": 2,
8
+ "head_dim": 128,
9
+ "hidden_act": "silu",
10
+ "hidden_size": 4096,
11
+ "initializer_range": 0.02,
12
+ "intermediate_size": 12288,
13
+ "max_position_embeddings": 32768,
14
+ "model_type": "mistral",
15
+ "num_attention_heads": 32,
16
+ "num_hidden_layers": 36,
17
+ "num_key_value_heads": 8,
18
+ "rms_norm_eps": 1e-05,
19
+ "rope_theta": 100000000.0,
20
+ "sliding_window": 32768,
21
+ "tie_word_embeddings": false,
22
+ "torch_dtype": "bfloat16",
23
+ "transformers_version": "4.46.0.dev0",
24
+ "use_cache": true,
25
+ "vocab_size": 131072
26
+ }
generation_config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 1,
4
+ "eos_token_id": 2,
5
+ "transformers_version": "4.46.0.dev0"
6
+ }
model.safetensors.index.json ADDED
@@ -0,0 +1,334 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "metadata": {
3
+ "total_size": 16039616512
4
+ },
5
+ "weight_map": {
6
+ "lm_head.weight": "model-00004-of-00004.safetensors",
7
+ "model.embed_tokens.weight": "model-00001-of-00004.safetensors",
8
+ "model.layers.0.input_layernorm.weight": "model-00001-of-00004.safetensors",
9
+ "model.layers.0.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
10
+ "model.layers.0.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
11
+ "model.layers.0.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
12
+ "model.layers.0.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
13
+ "model.layers.0.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
14
+ "model.layers.0.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
15
+ "model.layers.0.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
16
+ "model.layers.0.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
17
+ "model.layers.1.input_layernorm.weight": "model-00001-of-00004.safetensors",
18
+ "model.layers.1.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
19
+ "model.layers.1.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
20
+ "model.layers.1.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
21
+ "model.layers.1.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
22
+ "model.layers.1.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
23
+ "model.layers.1.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
24
+ "model.layers.1.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
25
+ "model.layers.1.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
26
+ "model.layers.10.input_layernorm.weight": "model-00002-of-00004.safetensors",
27
+ "model.layers.10.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
28
+ "model.layers.10.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
29
+ "model.layers.10.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
30
+ "model.layers.10.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
31
+ "model.layers.10.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
32
+ "model.layers.10.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
33
+ "model.layers.10.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
34
+ "model.layers.10.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
35
+ "model.layers.11.input_layernorm.weight": "model-00002-of-00004.safetensors",
36
+ "model.layers.11.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
37
+ "model.layers.11.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
38
+ "model.layers.11.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
39
+ "model.layers.11.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
40
+ "model.layers.11.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
41
+ "model.layers.11.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
42
+ "model.layers.11.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
43
+ "model.layers.11.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
44
+ "model.layers.12.input_layernorm.weight": "model-00002-of-00004.safetensors",
45
+ "model.layers.12.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
46
+ "model.layers.12.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
47
+ "model.layers.12.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
48
+ "model.layers.12.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
49
+ "model.layers.12.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
50
+ "model.layers.12.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
51
+ "model.layers.12.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
52
+ "model.layers.12.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
53
+ "model.layers.13.input_layernorm.weight": "model-00002-of-00004.safetensors",
54
+ "model.layers.13.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
55
+ "model.layers.13.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
56
+ "model.layers.13.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
57
+ "model.layers.13.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
58
+ "model.layers.13.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
59
+ "model.layers.13.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
60
+ "model.layers.13.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
61
+ "model.layers.13.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
62
+ "model.layers.14.input_layernorm.weight": "model-00002-of-00004.safetensors",
63
+ "model.layers.14.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
64
+ "model.layers.14.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
65
+ "model.layers.14.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
66
+ "model.layers.14.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
67
+ "model.layers.14.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
68
+ "model.layers.14.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
69
+ "model.layers.14.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
70
+ "model.layers.14.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
71
+ "model.layers.15.input_layernorm.weight": "model-00002-of-00004.safetensors",
72
+ "model.layers.15.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
73
+ "model.layers.15.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
74
+ "model.layers.15.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
75
+ "model.layers.15.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
76
+ "model.layers.15.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
77
+ "model.layers.15.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
78
+ "model.layers.15.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
79
+ "model.layers.15.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
80
+ "model.layers.16.input_layernorm.weight": "model-00002-of-00004.safetensors",
81
+ "model.layers.16.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
82
+ "model.layers.16.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
83
+ "model.layers.16.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
84
+ "model.layers.16.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
85
+ "model.layers.16.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
86
+ "model.layers.16.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
87
+ "model.layers.16.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
88
+ "model.layers.16.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
89
+ "model.layers.17.input_layernorm.weight": "model-00002-of-00004.safetensors",
90
+ "model.layers.17.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
91
+ "model.layers.17.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
92
+ "model.layers.17.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
93
+ "model.layers.17.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
94
+ "model.layers.17.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
95
+ "model.layers.17.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
96
+ "model.layers.17.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
97
+ "model.layers.17.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
98
+ "model.layers.18.input_layernorm.weight": "model-00002-of-00004.safetensors",
99
+ "model.layers.18.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
100
+ "model.layers.18.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
101
+ "model.layers.18.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
102
+ "model.layers.18.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
103
+ "model.layers.18.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
104
+ "model.layers.18.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
105
+ "model.layers.18.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
106
+ "model.layers.18.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
107
+ "model.layers.19.input_layernorm.weight": "model-00002-of-00004.safetensors",
108
+ "model.layers.19.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
109
+ "model.layers.19.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
110
+ "model.layers.19.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
111
+ "model.layers.19.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
112
+ "model.layers.19.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
113
+ "model.layers.19.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
114
+ "model.layers.19.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
115
+ "model.layers.19.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
116
+ "model.layers.2.input_layernorm.weight": "model-00001-of-00004.safetensors",
117
+ "model.layers.2.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
118
+ "model.layers.2.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
119
+ "model.layers.2.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
120
+ "model.layers.2.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
121
+ "model.layers.2.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
122
+ "model.layers.2.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
123
+ "model.layers.2.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
124
+ "model.layers.2.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
125
+ "model.layers.20.input_layernorm.weight": "model-00002-of-00004.safetensors",
126
+ "model.layers.20.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
127
+ "model.layers.20.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
128
+ "model.layers.20.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
129
+ "model.layers.20.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
130
+ "model.layers.20.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
131
+ "model.layers.20.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
132
+ "model.layers.20.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
133
+ "model.layers.20.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
134
+ "model.layers.21.input_layernorm.weight": "model-00002-of-00004.safetensors",
135
+ "model.layers.21.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
136
+ "model.layers.21.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
137
+ "model.layers.21.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
138
+ "model.layers.21.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
139
+ "model.layers.21.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
140
+ "model.layers.21.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
141
+ "model.layers.21.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
142
+ "model.layers.21.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
143
+ "model.layers.22.input_layernorm.weight": "model-00002-of-00004.safetensors",
144
+ "model.layers.22.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
145
+ "model.layers.22.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
146
+ "model.layers.22.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
147
+ "model.layers.22.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
148
+ "model.layers.22.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
149
+ "model.layers.22.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
150
+ "model.layers.22.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
151
+ "model.layers.22.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
152
+ "model.layers.23.input_layernorm.weight": "model-00003-of-00004.safetensors",
153
+ "model.layers.23.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
154
+ "model.layers.23.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
155
+ "model.layers.23.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
156
+ "model.layers.23.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
157
+ "model.layers.23.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
158
+ "model.layers.23.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
159
+ "model.layers.23.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
160
+ "model.layers.23.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
161
+ "model.layers.24.input_layernorm.weight": "model-00003-of-00004.safetensors",
162
+ "model.layers.24.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
163
+ "model.layers.24.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
164
+ "model.layers.24.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
165
+ "model.layers.24.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
166
+ "model.layers.24.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
167
+ "model.layers.24.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
168
+ "model.layers.24.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
169
+ "model.layers.24.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
170
+ "model.layers.25.input_layernorm.weight": "model-00003-of-00004.safetensors",
171
+ "model.layers.25.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
172
+ "model.layers.25.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
173
+ "model.layers.25.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
174
+ "model.layers.25.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
175
+ "model.layers.25.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
176
+ "model.layers.25.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
177
+ "model.layers.25.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
178
+ "model.layers.25.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
179
+ "model.layers.26.input_layernorm.weight": "model-00003-of-00004.safetensors",
180
+ "model.layers.26.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
181
+ "model.layers.26.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
182
+ "model.layers.26.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
183
+ "model.layers.26.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
184
+ "model.layers.26.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
185
+ "model.layers.26.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
186
+ "model.layers.26.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
187
+ "model.layers.26.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
188
+ "model.layers.27.input_layernorm.weight": "model-00003-of-00004.safetensors",
189
+ "model.layers.27.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
190
+ "model.layers.27.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
191
+ "model.layers.27.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
192
+ "model.layers.27.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
193
+ "model.layers.27.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
194
+ "model.layers.27.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
195
+ "model.layers.27.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
196
+ "model.layers.27.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
197
+ "model.layers.28.input_layernorm.weight": "model-00003-of-00004.safetensors",
198
+ "model.layers.28.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
199
+ "model.layers.28.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
200
+ "model.layers.28.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
201
+ "model.layers.28.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
202
+ "model.layers.28.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
203
+ "model.layers.28.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
204
+ "model.layers.28.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
205
+ "model.layers.28.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
206
+ "model.layers.29.input_layernorm.weight": "model-00003-of-00004.safetensors",
207
+ "model.layers.29.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
208
+ "model.layers.29.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
209
+ "model.layers.29.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
210
+ "model.layers.29.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
211
+ "model.layers.29.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
212
+ "model.layers.29.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
213
+ "model.layers.29.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
214
+ "model.layers.29.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
215
+ "model.layers.3.input_layernorm.weight": "model-00001-of-00004.safetensors",
216
+ "model.layers.3.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
217
+ "model.layers.3.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
218
+ "model.layers.3.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
219
+ "model.layers.3.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
220
+ "model.layers.3.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
221
+ "model.layers.3.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
222
+ "model.layers.3.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
223
+ "model.layers.3.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
224
+ "model.layers.30.input_layernorm.weight": "model-00003-of-00004.safetensors",
225
+ "model.layers.30.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
226
+ "model.layers.30.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
227
+ "model.layers.30.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
228
+ "model.layers.30.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
229
+ "model.layers.30.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
230
+ "model.layers.30.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
231
+ "model.layers.30.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
232
+ "model.layers.30.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
233
+ "model.layers.31.input_layernorm.weight": "model-00003-of-00004.safetensors",
234
+ "model.layers.31.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
235
+ "model.layers.31.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
236
+ "model.layers.31.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
237
+ "model.layers.31.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
238
+ "model.layers.31.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
239
+ "model.layers.31.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
240
+ "model.layers.31.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
241
+ "model.layers.31.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
242
+ "model.layers.32.input_layernorm.weight": "model-00003-of-00004.safetensors",
243
+ "model.layers.32.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
244
+ "model.layers.32.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
245
+ "model.layers.32.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
246
+ "model.layers.32.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
247
+ "model.layers.32.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
248
+ "model.layers.32.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
249
+ "model.layers.32.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
250
+ "model.layers.32.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
251
+ "model.layers.33.input_layernorm.weight": "model-00003-of-00004.safetensors",
252
+ "model.layers.33.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
253
+ "model.layers.33.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
254
+ "model.layers.33.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
255
+ "model.layers.33.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
256
+ "model.layers.33.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
257
+ "model.layers.33.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
258
+ "model.layers.33.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
259
+ "model.layers.33.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
260
+ "model.layers.34.input_layernorm.weight": "model-00003-of-00004.safetensors",
261
+ "model.layers.34.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
262
+ "model.layers.34.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
263
+ "model.layers.34.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
264
+ "model.layers.34.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
265
+ "model.layers.34.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
266
+ "model.layers.34.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
267
+ "model.layers.34.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
268
+ "model.layers.34.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
269
+ "model.layers.35.input_layernorm.weight": "model-00003-of-00004.safetensors",
270
+ "model.layers.35.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
271
+ "model.layers.35.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
272
+ "model.layers.35.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
273
+ "model.layers.35.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
274
+ "model.layers.35.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
275
+ "model.layers.35.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
276
+ "model.layers.35.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
277
+ "model.layers.35.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
278
+ "model.layers.4.input_layernorm.weight": "model-00001-of-00004.safetensors",
279
+ "model.layers.4.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
280
+ "model.layers.4.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
281
+ "model.layers.4.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
282
+ "model.layers.4.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
283
+ "model.layers.4.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
284
+ "model.layers.4.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
285
+ "model.layers.4.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
286
+ "model.layers.4.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
287
+ "model.layers.5.input_layernorm.weight": "model-00001-of-00004.safetensors",
288
+ "model.layers.5.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
289
+ "model.layers.5.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
290
+ "model.layers.5.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
291
+ "model.layers.5.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
292
+ "model.layers.5.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
293
+ "model.layers.5.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
294
+ "model.layers.5.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
295
+ "model.layers.5.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
296
+ "model.layers.6.input_layernorm.weight": "model-00001-of-00004.safetensors",
297
+ "model.layers.6.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
298
+ "model.layers.6.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
299
+ "model.layers.6.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
300
+ "model.layers.6.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
301
+ "model.layers.6.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
302
+ "model.layers.6.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
303
+ "model.layers.6.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
304
+ "model.layers.6.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
305
+ "model.layers.7.input_layernorm.weight": "model-00001-of-00004.safetensors",
306
+ "model.layers.7.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
307
+ "model.layers.7.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
308
+ "model.layers.7.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
309
+ "model.layers.7.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
310
+ "model.layers.7.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
311
+ "model.layers.7.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
312
+ "model.layers.7.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
313
+ "model.layers.7.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
314
+ "model.layers.8.input_layernorm.weight": "model-00001-of-00004.safetensors",
315
+ "model.layers.8.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
316
+ "model.layers.8.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
317
+ "model.layers.8.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
318
+ "model.layers.8.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
319
+ "model.layers.8.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
320
+ "model.layers.8.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
321
+ "model.layers.8.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
322
+ "model.layers.8.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
323
+ "model.layers.9.input_layernorm.weight": "model-00001-of-00004.safetensors",
324
+ "model.layers.9.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
325
+ "model.layers.9.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
326
+ "model.layers.9.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
327
+ "model.layers.9.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
328
+ "model.layers.9.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
329
+ "model.layers.9.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
330
+ "model.layers.9.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
331
+ "model.layers.9.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
332
+ "model.norm.weight": "model-00003-of-00004.safetensors"
333
+ }
334
+ }
params.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "dim": 4096,
3
+ "n_layers": 36,
4
+ "head_dim": 128,
5
+ "hidden_dim": 12288,
6
+ "n_heads": 32,
7
+ "n_kv_heads": 8,
8
+ "norm_eps": 1e-05,
9
+ "vocab_size": 131072,
10
+ "rope_theta": 100000000.0,
11
+ "max_seq_len": 32768,
12
+ "_sliding_window": [null, 32768, 32768, 32768]
13
+ }
passkey_example.json ADDED
The diff for this file is too large to render. See raw diff
 
special_tokens_map.json ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<s>",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "eos_token": {
10
+ "content": "</s>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "unk_token": {
17
+ "content": "<unk>",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ }
23
+ }
tekken.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eccd1665d2e477697c33cb7f0daa6f6dfefc57a0a6bceb66d4be52952f827516
3
+ size 14801223
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d7edbeaf20dd7f571b5dd1c54d9ace4f9b6299127cc7ba2afb14a6d51a4a79a4
3
+ size 17078136
tokenizer_config.json ADDED
The diff for this file is too large to render. See raw diff