TechxGenus commited on
Commit
16f8892
1 Parent(s): 0df07e2

Upload folder using huggingface_hub

Browse files
README.md ADDED
@@ -0,0 +1,236 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ GPTQ quantized version of Mistral-Large-Instruct-2407 model.
21
+
22
+ ---
23
+
24
+ # Model Card for Mistral-Large-Instruct-2407
25
+
26
+ 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.
27
+
28
+ For more details about this model please refer to our release [blog post](https://mistral.ai/news/mistral-large-2407/).
29
+
30
+ ## Key features
31
+ - **Multi-lingual by design:** Dozens of languages supported, including English, French, German, Spanish, Italian, Chinese, Japanese, Korean, Portuguese, Dutch and Polish.
32
+ - **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.
33
+ - **Agentic-centric:** Best-in-class agentic capabilities with native function calling and JSON outputting.
34
+ - **Advanced Reasoning:** State-of-the-art mathematical and reasoning capabilities.
35
+ - **Mistral Research License:** Allows usage and modification for research and non-commercial usages.
36
+ - **Large Context:** A large 128k context window.
37
+
38
+ ## Metrics
39
+
40
+ ### Base Pretrained Benchmarks
41
+
42
+ | Benchmark | Score |
43
+ | --- | --- |
44
+ | MMLU | 84.0% |
45
+
46
+
47
+ ### Base Pretrained Multilingual Benchmarks (MMLU)
48
+ | Benchmark | Score |
49
+ | --- | --- |
50
+ | French | 82.8% |
51
+ | German | 81.6% |
52
+ | Spanish | 82.7% |
53
+ | Italian | 82.7% |
54
+ | Dutch | 80.7% |
55
+ | Portuguese | 81.6% |
56
+ | Russian | 79.0% |
57
+ | Korean | 60.1% |
58
+ | Japanese | 78.8% |
59
+ | Chinese | 74.8% |
60
+
61
+
62
+ ### Instruction Benchmarks
63
+
64
+ | Benchmark | Score |
65
+ | --- | --- |
66
+ | MT Bench | 8.63 |
67
+ | Wild Bench | 56.3 |
68
+ | Arena Hard| 73.2 |
69
+
70
+ ### Code & Reasoning Benchmarks
71
+ | Benchmark | Score |
72
+ | --- | --- |
73
+ | Human Eval | 92% |
74
+ | Human Eval Plus| 87% |
75
+ | MBPP Base| 80% |
76
+ | MBPP Plus| 69% |
77
+
78
+ ### Math Benchmarks
79
+
80
+ | Benchmark | Score |
81
+ | --- | --- |
82
+ | GSM8K | 93% |
83
+ | Math Instruct (0-shot, no CoT) | 70% |
84
+ | Math Instruct (0-shot, CoT)| 71.5% |
85
+
86
+ ## Usage
87
+
88
+ The model can be used with two different frameworks
89
+
90
+ - [`mistral_inference`](https://github.com/mistralai/mistral-inference): See [here](https://huggingface.co/mistralai/Mistral-Large-2407#mistral-inference)
91
+ - [`transformers`](https://github.com/huggingface/transformers): See [here](#transformers)
92
+
93
+ ### Mistral Inference
94
+
95
+ #### Install
96
+
97
+ It is recommended to use `mistralai/Mistral-Large-2407` with [mistral-inference](https://github.com/mistralai/mistral-inference). For HF transformers code snippets, please keep scrolling.
98
+
99
+ ```
100
+ pip install mistral_inference
101
+ ```
102
+
103
+ #### Download
104
+
105
+ ```py
106
+ from huggingface_hub import snapshot_download
107
+ from pathlib import Path
108
+
109
+ mistral_models_path = Path.home().joinpath('mistral_models', 'Large')
110
+ mistral_models_path.mkdir(parents=True, exist_ok=True)
111
+
112
+ snapshot_download(repo_id="mistralai/Mistral-Large-2407", allow_patterns=["params.json", "consolidated-*.safetensors", "tokenizer.model.v3"], local_dir=mistral_models_path)
113
+ ```
114
+
115
+ #### Chat
116
+
117
+ After installing `mistral_inference`, a `mistral-chat` CLI command should be available in your environment.
118
+ Given the size of this model, you will need a node with several GPUs (more than 300GB cumulated vRAM).
119
+ If you have 8 GPUs on your machine, you can chat with the model using
120
+
121
+ ```
122
+ torchrun --nproc-per-node 8 --no-python mistral-chat $HOME/mistral_models/Large --instruct --max_tokens 256 --temperature 0.7
123
+ ```
124
+
125
+ *E.g.* Try out something like:
126
+ ```
127
+ How expensive would it be to ask a window cleaner to clean all windows in Paris. Make a reasonable guess in US Dollar.
128
+ ```
129
+
130
+ #### Instruct following
131
+
132
+ ```py
133
+ from mistral_inference.transformer import Transformer
134
+ from mistral_inference.generate import generate
135
+
136
+ from mistral_common.tokens.tokenizers.mistral import MistralTokenizer
137
+ from mistral_common.protocol.instruct.messages import UserMessage
138
+ from mistral_common.protocol.instruct.request import ChatCompletionRequest
139
+
140
+ tokenizer = MistralTokenizer.from_file(f"{mistral_models_path}/tokenizer.model.v3")
141
+ model = Transformer.from_folder(mistral_models_path)
142
+
143
+ prompt = "How expensive would it be to ask a window cleaner to clean all windows in Paris. Make a reasonable guess in US Dollar."
144
+
145
+ completion_request = ChatCompletionRequest(messages=[UserMessage(content=prompt)])
146
+
147
+ tokens = tokenizer.encode_chat_completion(completion_request).tokens
148
+
149
+ out_tokens, _ = generate([tokens], model, max_tokens=64, temperature=0.7, eos_id=tokenizer.instruct_tokenizer.tokenizer.eos_id)
150
+ result = tokenizer.decode(out_tokens[0])
151
+
152
+ print(result)
153
+ ```
154
+
155
+ #### Function calling
156
+
157
+ ```py
158
+ from mistral_common.protocol.instruct.tool_calls import Function, Tool
159
+ from mistral_inference.transformer import Transformer
160
+ from mistral_inference.generate import generate
161
+
162
+ from mistral_common.tokens.tokenizers.mistral import MistralTokenizer
163
+ from mistral_common.protocol.instruct.messages import UserMessage
164
+ from mistral_common.protocol.instruct.request import ChatCompletionRequest
165
+
166
+
167
+ tokenizer = MistralTokenizer.from_file(f"{mistral_models_path}/tokenizer.model.v3")
168
+ model = Transformer.from_folder(mistral_models_path)
169
+
170
+ completion_request = ChatCompletionRequest(
171
+ tools=[
172
+ Tool(
173
+ function=Function(
174
+ name="get_current_weather",
175
+ description="Get the current weather",
176
+ parameters={
177
+ "type": "object",
178
+ "properties": {
179
+ "location": {
180
+ "type": "string",
181
+ "description": "The city and state, e.g. San Francisco, CA",
182
+ },
183
+ "format": {
184
+ "type": "string",
185
+ "enum": ["celsius", "fahrenheit"],
186
+ "description": "The temperature unit to use. Infer this from the users location.",
187
+ },
188
+ },
189
+ "required": ["location", "format"],
190
+ },
191
+ )
192
+ )
193
+ ],
194
+ messages=[
195
+ UserMessage(content="What's the weather like today in Paris?"),
196
+ ],
197
+ )
198
+
199
+ tokens = tokenizer.encode_chat_completion(completion_request).tokens
200
+
201
+ out_tokens, _ = generate([tokens], model, max_tokens=256, temperature=0.7, eos_id=tokenizer.instruct_tokenizer.tokenizer.eos_id)
202
+ result = tokenizer.decode(out_tokens[0])
203
+
204
+ print(result)
205
+ ```
206
+
207
+ ### Transformers
208
+
209
+ > [!IMPORTANT]
210
+ > NOTE: Until a new release has been made, you need to install transformers from source:
211
+ > ```sh
212
+ > pip install git+https://github.com/huggingface/transformers.git
213
+ > ```
214
+
215
+ If you want to use Hugging Face `transformers` to generate text, you can do something like this.
216
+
217
+ ```py
218
+ from transformers import pipeline
219
+
220
+ messages = [
221
+ {"role": "system", "content": "You are a pirate chatbot who always responds in pirate speak!"},
222
+ {"role": "user", "content": "Who are you?"},
223
+ ]
224
+ chatbot = pipeline("text-generation", model="mistralai/Mistral-Large-2407")
225
+ chatbot(messages)
226
+ ```
227
+
228
+ ## Limitations
229
+
230
+ The Mistral Large model is a quick demonstration that the base model can be easily fine-tuned to achieve compelling performance.
231
+ It does not have any moderation mechanisms. We're looking forward to engaging with the community on ways to
232
+ make the model finely respect guardrails, allowing for deployment in environments requiring moderated outputs.
233
+
234
+ ## The Mistral AI Team
235
+
236
+ 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
config.json ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "mistralai/Mistral-Large-Instruct-2407",
3
+ "architectures": [
4
+ "MistralForCausalLM"
5
+ ],
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": 1,
8
+ "eos_token_id": 2,
9
+ "head_dim": 128,
10
+ "hidden_act": "silu",
11
+ "hidden_size": 12288,
12
+ "initializer_range": 0.02,
13
+ "intermediate_size": 28672,
14
+ "max_position_embeddings": 32768,
15
+ "model_type": "mistral",
16
+ "num_attention_heads": 96,
17
+ "num_hidden_layers": 88,
18
+ "num_key_value_heads": 8,
19
+ "quantization_config": {
20
+ "bits": 4,
21
+ "checkpoint_format": "gptq",
22
+ "damp_percent": 0.005,
23
+ "desc_act": true,
24
+ "group_size": 128,
25
+ "lm_head": false,
26
+ "model_file_base_name": null,
27
+ "model_name_or_path": null,
28
+ "quant_method": "gptq",
29
+ "static_groups": false,
30
+ "sym": true,
31
+ "true_sequential": true
32
+ },
33
+ "rms_norm_eps": 1e-05,
34
+ "rope_theta": 1000000.0,
35
+ "sliding_window": null,
36
+ "tie_word_embeddings": false,
37
+ "torch_dtype": "bfloat16",
38
+ "transformers_version": "4.43.2",
39
+ "use_cache": true,
40
+ "vocab_size": 32768
41
+ }
model-00001-of-00014.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b5e63210e76eb94927117b4f24bee1c70938017aaea823a6449308f528692798
3
+ size 4939435304
model-00002-of-00014.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cdd2e77ac6a87809fba243d0682d8536ae57f9b4238282edf3cbd8dd3c29527a
3
+ size 4853799744
model-00003-of-00014.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c0d8252614b5688f00a1b0fd95180e738684b9436225ac97b152f93a275f84bd
3
+ size 4853799864
model-00004-of-00014.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4beb26a740ce99acafbfa9fd9db9c61d633b879370bca103064f60022b434e25
3
+ size 4958395320
model-00005-of-00014.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7f2bc4aeefa06778f2b4ae50986eea9ae033c0c41f01d59b191790580a5fc3fc
3
+ size 4945221664
model-00006-of-00014.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:64e9f5a69e4998f07e2e181df79b6e61b7ac18b56aa37a83bafba371a1bd3137
3
+ size 4853684936
model-00007-of-00014.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fa893555bc15b74c2e64faee4572a6257c15c9e5754dd49d2448884e5b27d273
3
+ size 4853799864
model-00008-of-00014.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:277b0d904208cf0034c49416991a78485d577fe8f136a56e8d521aecf8e770de
3
+ size 4853799864
model-00009-of-00014.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:98eec3bd0891f2bebb37e96bc91c1e34e82d0902009779b9f8d00d539fea3740
3
+ size 4958395320
model-00010-of-00014.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e08e07fa28dc2a07f94d56c154f14dde348ccdb68be3abb201a26978b912d82d
3
+ size 4945221664
model-00011-of-00014.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1e3d9d601866cb7c260f7fc795b970850134ccdbd24eaf07f9ae9f7fdae9b1de
3
+ size 4853684936
model-00012-of-00014.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e119c8b3742f19f357ffc851796f16fd3775384aa2c5607e0bd2b4ee66dd7d77
3
+ size 4853799864
model-00013-of-00014.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:25be5f00974f03d2a141d2ec650d5338f82197c949067060e5a2da367c14f6f9
3
+ size 4853799864
model-00014-of-00014.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:716104e2aa778eb718816601ab65547f5f6dfd9da21dcb64d6dcdf45975af09e
3
+ size 1354721008
model.safetensors.index.json ADDED
The diff for this file is too large to render. See raw diff
 
quantize_config.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bits": 4,
3
+ "group_size": 128,
4
+ "desc_act": true,
5
+ "static_groups": false,
6
+ "sym": true,
7
+ "lm_head": false,
8
+ "damp_percent": 0.005,
9
+ "true_sequential": true,
10
+ "model_name_or_path": "./Mistral-Large-Instruct-2407-GPTQ",
11
+ "model_file_base_name": "model",
12
+ "quant_method": "gptq",
13
+ "checkpoint_format": "gptq"
14
+ }
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
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:59f95e28944c062244741268596badc900df86c7f5ded05088d2da22a7379e06
3
+ size 587583
tokenizer_config.json ADDED
The diff for this file is too large to render. See raw diff