rAIfle commited on
Commit
32f58d9
1 Parent(s): 70eb0dc

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +263 -0
README.md ADDED
@@ -0,0 +1,263 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ license_name: mrl
4
+ license_link: https://mistral.ai/licenses/MRL-0.1.md
5
+ language:
6
+ - en
7
+ - fr
8
+ - de
9
+ - es
10
+ - it
11
+ - pt
12
+ - zh
13
+ - ja
14
+ - ru
15
+ - ko
16
+
17
+ extra_gated_description: If you want to learn more about how we process your personal data, please read our <a href="https://mistral.ai/terms/">Privacy Policy</a>.
18
+ ---
19
+ ```
20
+ e88 88e d8
21
+ d888 888b 8888 8888 ,"Y88b 888 8e d88
22
+ C8888 8888D 8888 8888 "8" 888 888 88b d88888
23
+ Y888 888P Y888 888P ,ee 888 888 888 888
24
+ "88 88" "88 88" "88 888 888 888 888
25
+ b
26
+ 8b,
27
+
28
+ e88'Y88 d8 888
29
+ d888 'Y ,"Y88b 888,8, d88 ,e e, 888
30
+ C8888 "8" 888 888 " d88888 d88 88b 888
31
+ Y888 ,d ,ee 888 888 888 888 , 888
32
+ "88,d88 "88 888 888 888 "YeeP" 888
33
+
34
+ PROUDLY PRESENTS
35
+ ```
36
+ # Mistral-Large-Instruct-2407-exl2-longcal
37
+
38
+ Quantized using 115 rows of 8192 tokens from the default ExLlamav2-calibration dataset.
39
+
40
+ Branches:
41
+ - `main` -- `measurement.json`
42
+ - `8b8h` -- 8bpw, 8bit lm_head
43
+ - `6b6h` -- 6bpw, 6bit lm_head
44
+ - `5b6h` -- 5bpw, 6bit lm_head
45
+ - `4b6h` -- 4bpw, 6bit lm_head
46
+ - `3.5b6h` -- 3.5bpw, 6bit lm_head
47
+ - `2.25b6h` -- 2.25bpw, 6bit lm_head
48
+
49
+ Original model link: [mistralai/Mistral-Large-Instruct-2407](https://huggingface.co/mistralai/Mistral-Large-Instruct-2407)
50
+
51
+ ### Quanter's notes
52
+ As apparently the default dataset is supposed to be better in nearly all situations, I decided to start quanting using that in addition to my standard rpcal-fare. I'd appreciate real-world tests to confirm the hypothesis, though, so please leave a comment if you find this mode of quanting better than rpcal.
53
+
54
+ Original model README below.
55
+
56
+ -----
57
+ # Model Card for Mistral-Large-Instruct-2407
58
+
59
+ Mistral-Large-Instruct-2407 is an advanced dense Large Language Model (LLM) of 123B parameters with state-of-the-art reasoning, knowledge and coding capabilities.
60
+
61
+ For more details about this model please refer to our release [blog post](https://mistral.ai/news/mistral-large-2407/).
62
+
63
+ ## Key features
64
+ - **Multi-lingual by design:** Dozens of languages supported, including English, French, German, Spanish, Italian, Chinese, Japanese, Korean, Portuguese, Dutch and Polish.
65
+ - **Proficient in coding:** Trained on 80+ coding languages such as Python, Java, C, C++, Javacsript, and Bash. Also trained on more specific languages such as Swift and Fortran.
66
+ - **Agentic-centric:** Best-in-class agentic capabilities with native function calling and JSON outputting.
67
+ - **Advanced Reasoning:** State-of-the-art mathematical and reasoning capabilities.
68
+ - **Mistral Research License:** Allows usage and modification for research and non-commercial usages.
69
+ - **Large Context:** A large 128k context window.
70
+
71
+ ## Metrics
72
+
73
+ ### Base Pretrained Benchmarks
74
+
75
+ | Benchmark | Score |
76
+ | --- | --- |
77
+ | MMLU | 84.0% |
78
+
79
+
80
+ ### Base Pretrained Multilingual Benchmarks (MMLU)
81
+ | Benchmark | Score |
82
+ | --- | --- |
83
+ | French | 82.8% |
84
+ | German | 81.6% |
85
+ | Spanish | 82.7% |
86
+ | Italian | 82.7% |
87
+ | Dutch | 80.7% |
88
+ | Portuguese | 81.6% |
89
+ | Russian | 79.0% |
90
+ | Korean | 60.1% |
91
+ | Japanese | 78.8% |
92
+ | Chinese | 74.8% |
93
+
94
+
95
+ ### Instruction Benchmarks
96
+
97
+ | Benchmark | Score |
98
+ | --- | --- |
99
+ | MT Bench | 8.63 |
100
+ | Wild Bench | 56.3 |
101
+ | Arena Hard| 73.2 |
102
+
103
+ ### Code & Reasoning Benchmarks
104
+ | Benchmark | Score |
105
+ | --- | --- |
106
+ | Human Eval | 92% |
107
+ | Human Eval Plus| 87% |
108
+ | MBPP Base| 80% |
109
+ | MBPP Plus| 69% |
110
+
111
+ ### Math Benchmarks
112
+
113
+ | Benchmark | Score |
114
+ | --- | --- |
115
+ | GSM8K | 93% |
116
+ | Math Instruct (0-shot, no CoT) | 70% |
117
+ | Math Instruct (0-shot, CoT)| 71.5% |
118
+
119
+ ## Usage
120
+
121
+ The model can be used with two different frameworks
122
+
123
+ - [`mistral_inference`](https://github.com/mistralai/mistral-inference): See [here](#mistral-inference)
124
+ - [`transformers`](https://github.com/huggingface/transformers): See [here](#transformers)
125
+
126
+ ### Mistral Inference
127
+
128
+ #### Install
129
+
130
+ It is recommended to use `mistralai/Mistral-Large-Instruct-2407` with [mistral-inference](https://github.com/mistralai/mistral-inference). For HF transformers code snippets, please keep scrolling.
131
+
132
+ ```
133
+ pip install mistral_inference
134
+ ```
135
+
136
+ #### Download
137
+
138
+ ```py
139
+ from huggingface_hub import snapshot_download
140
+ from pathlib import Path
141
+
142
+ mistral_models_path = Path.home().joinpath('mistral_models', 'Large')
143
+ mistral_models_path.mkdir(parents=True, exist_ok=True)
144
+
145
+ snapshot_download(repo_id="mistralai/Mistral-Large-Instruct-2407", allow_patterns=["params.json", "consolidated-*.safetensors", "tokenizer.model.v3"], local_dir=mistral_models_path)
146
+ ```
147
+
148
+ #### Chat
149
+
150
+ After installing `mistral_inference`, a `mistral-chat` CLI command should be available in your environment.
151
+ Given the size of this model, you will need a node with several GPUs (more than 300GB cumulated vRAM).
152
+ If you have 8 GPUs on your machine, you can chat with the model using
153
+
154
+ ```
155
+ torchrun --nproc-per-node 8 --no-python mistral-chat $HOME/mistral_models/Large --instruct --max_tokens 256 --temperature 0.7
156
+ ```
157
+
158
+ *E.g.* Try out something like:
159
+ ```
160
+ How expensive would it be to ask a window cleaner to clean all windows in Paris. Make a reasonable guess in US Dollar.
161
+ ```
162
+
163
+ #### Instruct following
164
+
165
+ ```py
166
+ from mistral_inference.transformer import Transformer
167
+ from mistral_inference.generate import generate
168
+
169
+ from mistral_common.tokens.tokenizers.mistral import MistralTokenizer
170
+ from mistral_common.protocol.instruct.messages import UserMessage
171
+ from mistral_common.protocol.instruct.request import ChatCompletionRequest
172
+
173
+ tokenizer = MistralTokenizer.from_file(f"{mistral_models_path}/tokenizer.model.v3")
174
+ model = Transformer.from_folder(mistral_models_path)
175
+
176
+ prompt = "How expensive would it be to ask a window cleaner to clean all windows in Paris. Make a reasonable guess in US Dollar."
177
+
178
+ completion_request = ChatCompletionRequest(messages=[UserMessage(content=prompt)])
179
+
180
+ tokens = tokenizer.encode_chat_completion(completion_request).tokens
181
+
182
+ out_tokens, _ = generate([tokens], model, max_tokens=64, temperature=0.7, eos_id=tokenizer.instruct_tokenizer.tokenizer.eos_id)
183
+ result = tokenizer.decode(out_tokens[0])
184
+
185
+ print(result)
186
+ ```
187
+
188
+ #### Function calling
189
+
190
+ ```py
191
+ from mistral_common.protocol.instruct.tool_calls import Function, Tool
192
+ from mistral_inference.transformer import Transformer
193
+ from mistral_inference.generate import generate
194
+
195
+ from mistral_common.tokens.tokenizers.mistral import MistralTokenizer
196
+ from mistral_common.protocol.instruct.messages import UserMessage
197
+ from mistral_common.protocol.instruct.request import ChatCompletionRequest
198
+
199
+
200
+ tokenizer = MistralTokenizer.from_file(f"{mistral_models_path}/tokenizer.model.v3")
201
+ model = Transformer.from_folder(mistral_models_path)
202
+
203
+ completion_request = ChatCompletionRequest(
204
+ tools=[
205
+ Tool(
206
+ function=Function(
207
+ name="get_current_weather",
208
+ description="Get the current weather",
209
+ parameters={
210
+ "type": "object",
211
+ "properties": {
212
+ "location": {
213
+ "type": "string",
214
+ "description": "The city and state, e.g. San Francisco, CA",
215
+ },
216
+ "format": {
217
+ "type": "string",
218
+ "enum": ["celsius", "fahrenheit"],
219
+ "description": "The temperature unit to use. Infer this from the users location.",
220
+ },
221
+ },
222
+ "required": ["location", "format"],
223
+ },
224
+ )
225
+ )
226
+ ],
227
+ messages=[
228
+ UserMessage(content="What's the weather like today in Paris?"),
229
+ ],
230
+ )
231
+
232
+ tokens = tokenizer.encode_chat_completion(completion_request).tokens
233
+
234
+ out_tokens, _ = generate([tokens], model, max_tokens=256, temperature=0.7, eos_id=tokenizer.instruct_tokenizer.tokenizer.eos_id)
235
+ result = tokenizer.decode(out_tokens[0])
236
+
237
+ print(result)
238
+ ```
239
+
240
+ ### Transformers
241
+
242
+ If you want to use Hugging Face `transformers` to generate text, you can do something like this.
243
+
244
+ ```py
245
+ from transformers import pipeline
246
+
247
+ messages = [
248
+ {"role": "system", "content": "You are a pirate chatbot who always responds in pirate speak!"},
249
+ {"role": "user", "content": "Who are you?"},
250
+ ]
251
+ chatbot = pipeline("text-generation", model="mistralai/Mistral-Large-Instruct-2407")
252
+ chatbot(messages)
253
+ ```
254
+
255
+ ## Limitations
256
+
257
+ The Mistral Large model is a quick demonstration that the base model can be easily fine-tuned to achieve compelling performance.
258
+ It does not have any moderation mechanisms. We're looking forward to engaging with the community on ways to
259
+ make the model finely respect guardrails, allowing for deployment in environments requiring moderated outputs.
260
+
261
+ ## The Mistral AI Team
262
+
263
+ Albert Jiang, Alexandre Sablayrolles, Alexis Tacnet, Alok Kothari, Antoine Roux, Arthur Mensch, Audrey Herblin-Stoop, Augustin Garreau, Austin Birky, Bam4d, Baptiste Bout, Baudouin de Monicault, Blanche Savary, Carole Rambaud, Caroline Feldman, Devendra Singh Chaplot, Diego de las Casas, Diogo Costa, Eleonore Arcelin, Emma Bou Hanna, Etienne Metzger, Gaspard Blanchet, Gianna Lengyel, Guillaume Bour, Guillaume Lample, Harizo Rajaona, Henri Roussez, Hichem Sattouf, Ian Mack, Jean-Malo Delignon, Jessica Chudnovsky, Justus Murke, Kartik Khandelwal, Lawrence Stewart, Louis Martin, Louis Ternon, Lucile Saulnier, Lélio Renard Lavaud, Margaret Jennings, Marie Pellat, Marie Torelli, Marie-Anne Lachaux, Marjorie Janiewicz, Mickaël Seznec, Nicolas Schuhl, Niklas Muhs, Olivier de Garrigues, Patrick von Platen, Paul Jacob, Pauline Buche, Pavan Kumar Reddy, Perry Savas, Pierre Stock, Romain Sauvestre, Sagar Vaze, Sandeep Subramanian, Saurabh Garg, Sophia Yang, Szymon Antoniak, Teven Le Scao, Thibault Schueller, Thibaut Lavril, Thomas Wang, Théophile Gervet, Timothée Lacroix, Valera Nemychnikova, Wendy Shang, William El Sayed, William Marshall