andrijdavid commited on
Commit
91989d0
·
verified ·
1 Parent(s): de751c3

Upload folder using huggingface_hub

Browse files
.gitattributes CHANGED
@@ -33,3 +33,20 @@ 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
+ Q2_K/Q2_K-00001-of-00001.gguf filter=lfs diff=lfs merge=lfs -text
37
+ Q3_K/Q3_K-00001-of-00001.gguf filter=lfs diff=lfs merge=lfs -text
38
+ Q3_K_L/Q3_K_L-00001-of-00001.gguf filter=lfs diff=lfs merge=lfs -text
39
+ Q3_K_M/Q3_K_M-00001-of-00001.gguf filter=lfs diff=lfs merge=lfs -text
40
+ Q3_K_S/Q3_K_S-00001-of-00001.gguf filter=lfs diff=lfs merge=lfs -text
41
+ Q4_0/Q4_0-00001-of-00001.gguf filter=lfs diff=lfs merge=lfs -text
42
+ Q4_1/Q4_1-00001-of-00001.gguf filter=lfs diff=lfs merge=lfs -text
43
+ Q4_K/Q4_K-00001-of-00001.gguf filter=lfs diff=lfs merge=lfs -text
44
+ Q4_K_M/Q4_K_M-00001-of-00001.gguf filter=lfs diff=lfs merge=lfs -text
45
+ Q4_K_S/Q4_K_S-00001-of-00001.gguf filter=lfs diff=lfs merge=lfs -text
46
+ Q5_0/Q5_0-00001-of-00001.gguf filter=lfs diff=lfs merge=lfs -text
47
+ Q5_1/Q5_1-00001-of-00001.gguf filter=lfs diff=lfs merge=lfs -text
48
+ Q5_K/Q5_K-00001-of-00001.gguf filter=lfs diff=lfs merge=lfs -text
49
+ Q5_K_M/Q5_K_M-00001-of-00001.gguf filter=lfs diff=lfs merge=lfs -text
50
+ Q5_K_S/Q5_K_S-00001-of-00001.gguf filter=lfs diff=lfs merge=lfs -text
51
+ Q6_K/Q6_K-00001-of-00001.gguf filter=lfs diff=lfs merge=lfs -text
52
+ Q8_0/Q8_0-00001-of-00001.gguf filter=lfs diff=lfs merge=lfs -text
Q2_K/Q2_K-00001-of-00001.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d12ea48de350f281fd9171e1df2298d47b3f900ae9d3f9de90eb1380b27d1adb
3
+ size 2722877216
Q3_K/Q3_K-00001-of-00001.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ba89caabc10723c102d4c55f8c669a1bbc3561d2b07d516a5c7ffc01e13fae52
3
+ size 3522940704
Q3_K_L/Q3_K_L-00001-of-00001.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:47a126f5729ff6659c9c78598f8e92aeb6325a7c5e8dcda5a3d0ac363a25b4e3
3
+ size 3825979168
Q3_K_M/Q3_K_M-00001-of-00001.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ba89caabc10723c102d4c55f8c669a1bbc3561d2b07d516a5c7ffc01e13fae52
3
+ size 3522940704
Q3_K_S/Q3_K_S-00001-of-00001.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:481892ab86908126fb594b816dde569b65fa83771a708d17c4470d78c38cf063
3
+ size 3168522016
Q4_0/Q4_0-00001-of-00001.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0c15945fee64a679ea74069471ab3fecccb6766b482357b399eb5e0e1290e24c
3
+ size 4113288992
Q4_1/Q4_1-00001-of-00001.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dabfb38c3a5f9e1c41838f4bed3513be7f51fa4c5a80ba76cb7cf0397bdeb016
3
+ size 4557885216
Q4_K/Q4_K-00001-of-00001.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ed4d6085ae1f8035935e91cc0c9497698a339f9bca75ecdf4862082dfa9533fc
3
+ size 4372811552
Q4_K_M/Q4_K_M-00001-of-00001.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ed4d6085ae1f8035935e91cc0c9497698a339f9bca75ecdf4862082dfa9533fc
3
+ size 4372811552
Q4_K_S/Q4_K_S-00001-of-00001.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7bfa2c369c94c09ca6a44f12db2c896ca19b4797000a73250dc12e8dab40256c
3
+ size 4144746272
Q5_0/Q5_0-00001-of-00001.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:83dd22033c0fd36255c92896d19f6bf68f70c2455f6e707b1f0aaf27ae7c9b07
3
+ size 5002481440
Q5_1/Q5_1-00001-of-00001.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0abe33d73a4fdeddc381fd794541e0719568edccb2a1fba9b1ae59a644d1785b
3
+ size 5447077664
Q5_K/Q5_K-00001-of-00001.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bdfc332cc25258c6114a9537697c7d2114f4de9f93599b37772d4a57e0602a13
3
+ size 5136174880
Q5_K_M/Q5_K_M-00001-of-00001.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bdfc332cc25258c6114a9537697c7d2114f4de9f93599b37772d4a57e0602a13
3
+ size 5136174880
Q5_K_S/Q5_K_S-00001-of-00001.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f875d5150c54c1e2380b0769090226fcbbf93007070eee3d2c6766c803d015cd
3
+ size 5002481440
Q6_K/Q6_K-00001-of-00001.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5d9febc6d038026e3917dff60007ecbe59926d93dc74194c5b24a82beff8f81c
3
+ size 5947248416
Q8_0/Q8_0-00001-of-00001.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fedcf7fda58505171037af6d16a9828612f7c865a6328d4aa6e2661ac1eb1de1
3
+ size 7702564640
README.md ADDED
@@ -0,0 +1,287 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ tags:
4
+ - GGUF
5
+ extra_gated_description: If you want to learn more about how we process your personal
6
+ data, please read our <a href="https://mistral.ai/terms/">Privacy Policy</a>.
7
+ quantized_by: andrijdavid
8
+ ---
9
+ # mathstral-7B-v0.1-GGUF
10
+ - Original model: [mathstral-7B-v0.1](https://huggingface.co/mistralai/mathstral-7B-v0.1)
11
+
12
+ <!-- description start -->
13
+ ## Description
14
+
15
+ This repo contains GGUF format model files for [mathstral-7B-v0.1](https://huggingface.co/mistralai/mathstral-7B-v0.1).
16
+
17
+ <!-- description end -->
18
+ <!-- README_GGUF.md-about-gguf start -->
19
+ ### About GGUF
20
+ GGUF is a new format introduced by the llama.cpp team on August 21st 2023. It is a replacement for GGML, which is no longer supported by llama.cpp.
21
+ Here is an incomplete list of clients and libraries that are known to support GGUF:
22
+ * [llama.cpp](https://github.com/ggerganov/llama.cpp). This is the source project for GGUF, providing both a Command Line Interface (CLI) and a server option.
23
+ * [text-generation-webui](https://github.com/oobabooga/text-generation-webui), Known as the most widely used web UI, this project boasts numerous features and powerful extensions, and supports GPU acceleration.
24
+ * [Ollama](https://github.com/jmorganca/ollama) Ollama is a lightweight and extensible framework designed for building and running language models locally. It features a simple API for creating, managing, and executing models, along with a library of pre-built models for use in various applications​
25
+ * [KoboldCpp](https://github.com/LostRuins/koboldcpp), A comprehensive web UI offering GPU acceleration across all platforms and architectures, particularly renowned for storytelling.
26
+ * [GPT4All](https://gpt4all.io), This is a free and open source GUI that runs locally, supporting Windows, Linux, and macOS with full GPU acceleration.
27
+ * [LM Studio](https://lmstudio.ai/) An intuitive and powerful local GUI for Windows and macOS (Silicon), featuring GPU acceleration.
28
+ * [LoLLMS Web UI](https://github.com/ParisNeo/lollms-webui). A notable web UI with a variety of unique features, including a comprehensive model library for easy model selection.
29
+ * [Faraday.dev](https://faraday.dev/), An attractive, user-friendly character-based chat GUI for Windows and macOS (both Silicon and Intel), also offering GPU acceleration.
30
+ * [llama-cpp-python](https://github.com/abetlen/llama-cpp-python), A Python library equipped with GPU acceleration, LangChain support, and an OpenAI-compatible API server.
31
+ * [candle](https://github.com/huggingface/candle), A Rust-based ML framework focusing on performance, including GPU support, and designed for ease of use.
32
+ * [ctransformers](https://github.com/marella/ctransformers), A Python library featuring GPU acceleration, LangChain support, and an OpenAI-compatible AI server.
33
+ * [localGPT](https://github.com/PromtEngineer/localGPT) An open-source initiative enabling private conversations with documents.
34
+ <!-- README_GGUF.md-about-gguf end -->
35
+
36
+ <!-- compatibility_gguf start -->
37
+ ## Explanation of quantisation methods
38
+ <details>
39
+ <summary>Click to see details</summary>
40
+ The new methods available are:
41
+
42
+ * GGML_TYPE_Q2_K - "type-1" 2-bit quantization in super-blocks containing 16 blocks, each block having 16 weight. Block scales and mins are quantized with 4 bits. This ends up effectively using 2.5625 bits per weight (bpw)
43
+ * GGML_TYPE_Q3_K - "type-0" 3-bit quantization in super-blocks containing 16 blocks, each block having 16 weights. Scales are quantized with 6 bits. This end up using 3.4375 bpw.
44
+ * GGML_TYPE_Q4_K - "type-1" 4-bit quantization in super-blocks containing 8 blocks, each block having 32 weights. Scales and mins are quantized with 6 bits. This ends up using 4.5 bpw.
45
+ * GGML_TYPE_Q5_K - "type-1" 5-bit quantization. Same super-block structure as GGML_TYPE_Q4_K resulting in 5.5 bpw
46
+ * GGML_TYPE_Q6_K - "type-0" 6-bit quantization. Super-blocks with 16 blocks, each block having 16 weights. Scales are quantized with 8 bits. This ends up using 6.5625 bpw.
47
+ </details>
48
+ <!-- compatibility_gguf end -->
49
+
50
+ <!-- README_GGUF.md-how-to-download start -->
51
+ ## How to download GGUF files
52
+
53
+ **Note for manual downloaders:** You almost never want to clone the entire repo! Multiple different quantisation formats are provided, and most users only want to pick and download a single folder.
54
+
55
+ The following clients/libraries will automatically download models for you, providing a list of available models to choose from:
56
+
57
+ * LM Studio
58
+ * LoLLMS Web UI
59
+ * Faraday.dev
60
+
61
+ ### In `text-generation-webui`
62
+
63
+ Under Download Model, you can enter the model repo: LiteLLMs/mathstral-7B-v0.1-GGUF and below it, a specific filename to download, such as: Q4_0/Q4_0-00001-of-00001.gguf.
64
+
65
+ Then click Download.
66
+
67
+ ### On the command line, including multiple files at once
68
+
69
+ I recommend using the `huggingface-hub` Python library:
70
+
71
+ ```shell
72
+ pip3 install huggingface-hub
73
+ ```
74
+
75
+ Then you can download any individual model file to the current directory, at high speed, with a command like this:
76
+
77
+ ```shell
78
+ huggingface-cli download LiteLLMs/mathstral-7B-v0.1-GGUF Q4_0/Q4_0-00001-of-00001.gguf --local-dir . --local-dir-use-symlinks False
79
+ ```
80
+
81
+ <details>
82
+ <summary>More advanced huggingface-cli download usage (click to read)</summary>
83
+
84
+ You can also download multiple files at once with a pattern:
85
+
86
+ ```shell
87
+ huggingface-cli download LiteLLMs/mathstral-7B-v0.1-GGUF --local-dir . --local-dir-use-symlinks False --include='*Q4_K*gguf'
88
+ ```
89
+
90
+ For more documentation on downloading with `huggingface-cli`, please see: [HF -> Hub Python Library -> Download files -> Download from the CLI](https://huggingface.co/docs/huggingface_hub/guides/download#download-from-the-cli).
91
+
92
+ To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
93
+
94
+ ```shell
95
+ pip3 install huggingface_hub[hf_transfer]
96
+ ```
97
+
98
+ And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
99
+
100
+ ```shell
101
+ HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download LiteLLMs/mathstral-7B-v0.1-GGUF Q4_0/Q4_0-00001-of-00001.gguf --local-dir . --local-dir-use-symlinks False
102
+ ```
103
+
104
+ Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
105
+ </details>
106
+ <!-- README_GGUF.md-how-to-download end -->
107
+ <!-- README_GGUF.md-how-to-run start -->
108
+ ## Example `llama.cpp` command
109
+
110
+ Make sure you are using `llama.cpp` from commit [d0cee0d](https://github.com/ggerganov/llama.cpp/commit/d0cee0d36d5be95a0d9088b674dbb27354107221) or later.
111
+
112
+ ```shell
113
+ ./main -ngl 35 -m Q4_0/Q4_0-00001-of-00001.gguf --color -c --temp 0.7 --repeat_penalty 1.1 -n -1 -p "<PROMPT>"
114
+ ```
115
+
116
+ Change `-ngl 32` to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.
117
+
118
+ Change `-c ` to the desired sequence length. For extended sequence models - eg 8K, 16K, 32K - the necessary RoPE scaling parameters are read from the GGUF file and set by llama.cpp automatically. Note that longer sequence lengths require much more resources, so you may need to reduce this value.
119
+
120
+ If you want to have a chat-style conversation, replace the `-p <PROMPT>` argument with `-i -ins`
121
+
122
+ For other parameters and how to use them, please refer to [the llama.cpp documentation](https://github.com/ggerganov/llama.cpp/blob/master/examples/main/README.md)
123
+
124
+ ## How to run in `text-generation-webui`
125
+
126
+ Further instructions can be found in the text-generation-webui documentation, here: [text-generation-webui/docs/04 ‐ Model Tab.md](https://github.com/oobabooga/text-generation-webui/blob/main/docs/04%20%E2%80%90%20Model%20Tab.md#llamacpp).
127
+
128
+ ## How to run from Python code
129
+
130
+ You can use GGUF models from Python using the [llama-cpp-python](https://github.com/abetlen/llama-cpp-python) or [ctransformers](https://github.com/marella/ctransformers) libraries. Note that at the time of writing (Nov 27th 2023), ctransformers has not been updated for some time and is not compatible with some recent models. Therefore I recommend you use llama-cpp-python.
131
+
132
+ ### How to load this model in Python code, using llama-cpp-python
133
+
134
+ For full documentation, please see: [llama-cpp-python docs](https://abetlen.github.io/llama-cpp-python/).
135
+
136
+ #### First install the package
137
+
138
+ Run one of the following commands, according to your system:
139
+
140
+ ```shell
141
+ # Base ctransformers with no GPU acceleration
142
+ pip install llama-cpp-python
143
+ # With NVidia CUDA acceleration
144
+ CMAKE_ARGS="-DLLAMA_CUBLAS=on" pip install llama-cpp-python
145
+ # Or with OpenBLAS acceleration
146
+ CMAKE_ARGS="-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS" pip install llama-cpp-python
147
+ # Or with CLBLast acceleration
148
+ CMAKE_ARGS="-DLLAMA_CLBLAST=on" pip install llama-cpp-python
149
+ # Or with AMD ROCm GPU acceleration (Linux only)
150
+ CMAKE_ARGS="-DLLAMA_HIPBLAS=on" pip install llama-cpp-python
151
+ # Or with Metal GPU acceleration for macOS systems only
152
+ CMAKE_ARGS="-DLLAMA_METAL=on" pip install llama-cpp-python
153
+ # In windows, to set the variables CMAKE_ARGS in PowerShell, follow this format; eg for NVidia CUDA:
154
+ $env:CMAKE_ARGS = "-DLLAMA_OPENBLAS=on"
155
+ pip install llama-cpp-python
156
+ ```
157
+
158
+ #### Simple llama-cpp-python example code
159
+
160
+ ```python
161
+ from llama_cpp import Llama
162
+ # Set gpu_layers to the number of layers to offload to GPU. Set to 0 if no GPU acceleration is available on your system.
163
+ llm = Llama(
164
+ model_path="./Q4_0/Q4_0-00001-of-00001.gguf", # Download the model file first
165
+ n_ctx=32768, # The max sequence length to use - note that longer sequence lengths require much more resources
166
+ n_threads=8, # The number of CPU threads to use, tailor to your system and the resulting performance
167
+ n_gpu_layers=35 # The number of layers to offload to GPU, if you have GPU acceleration available
168
+ )
169
+ # Simple inference example
170
+ output = llm(
171
+ "<PROMPT>", # Prompt
172
+ max_tokens=512, # Generate up to 512 tokens
173
+ stop=["</s>"], # Example stop token - not necessarily correct for this specific model! Please check before using.
174
+ echo=True # Whether to echo the prompt
175
+ )
176
+ # Chat Completion API
177
+ llm = Llama(model_path="./Q4_0/Q4_0-00001-of-00001.gguf", chat_format="llama-2") # Set chat_format according to the model you are using
178
+ llm.create_chat_completion(
179
+ messages = [
180
+ {"role": "system", "content": "You are a story writing assistant."},
181
+ {
182
+ "role": "user",
183
+ "content": "Write a story about llamas."
184
+ }
185
+ ]
186
+ )
187
+ ```
188
+
189
+ ## How to use with LangChain
190
+
191
+ Here are guides on using llama-cpp-python and ctransformers with LangChain:
192
+
193
+ * [LangChain + llama-cpp-python](https://python.langchain.com/docs/integrations/llms/llamacpp)
194
+ * [LangChain + ctransformers](https://python.langchain.com/docs/integrations/providers/ctransformers)
195
+
196
+ <!-- README_GGUF.md-how-to-run end -->
197
+
198
+ <!-- footer end -->
199
+
200
+ <!-- original-model-card start -->
201
+ # Original model card: mathstral-7B-v0.1
202
+
203
+
204
+ # Model Card for Mathstral-7B-v0.1
205
+
206
+ Mathstral 7B is a model specializing in mathematical and scientific tasks, based on Mistral 7B.
207
+ You can read more in the [official blog post](https://mistral.ai/news/mathstral/).
208
+
209
+ ## Installation
210
+
211
+ It is recommended to use `mistralai/mathstral-7B-v0.1` with [mistral-inference](https://github.com/mistralai/mistral-inference)
212
+
213
+
214
+ ```
215
+ pip install mistral_inference>=1.2.0
216
+ ```
217
+
218
+
219
+ ## Download
220
+
221
+ ```py
222
+ from huggingface_hub import snapshot_download
223
+ from pathlib import Path
224
+
225
+ mistral_models_path = Path.home().joinpath('mistral_models', 'mathstral-7B-v0.1')
226
+ mistral_models_path.mkdir(parents=True, exist_ok=True)
227
+
228
+ snapshot_download(repo_id="mistralai/mathstral-7B-v0.1", allow_patterns=["params.json", "consolidated.safetensors", "tokenizer.model.v3"], local_dir=mistral_models_path)
229
+ ```
230
+
231
+ ### Chat
232
+
233
+ After installing `mistral_inference`, a `mistral-demo` CLI command should be available in your environment.
234
+
235
+ ```
236
+ mistral-chat $HOME/mistral_models/mathstral-7B-v0.1 --instruct --max_tokens 256
237
+ ```
238
+
239
+ You can then start chatting with the model, *e.g.* prompt it with something like:
240
+
241
+
242
+ *"Albert likes to surf every week. Each surfing session lasts for 4 hours and costs $20 per hour. How much would Albert spend in 5 weeks?"*
243
+
244
+ ### Usage in `transformers`
245
+
246
+ To use this model within the `transformers` library, install the latest release with `pip install --upgrade transformers` and run, for instance:
247
+
248
+ ```py
249
+ from transformers import MistralForCausalLM
250
+ from transformers import AutoTokenizer
251
+
252
+ tokenizer = AutoTokenizer.from_pretrained('mistralai/mathstral-7B-v0.1')
253
+
254
+ prompt = "What are the roots of unity?"
255
+ tokenized_prompts = tokenizer(prompt, return_tensors="pt")
256
+
257
+ model = MistralForCausalLM.from_pretrained('mistralai/mathstral-7B-v0.1')
258
+ generation = model.generate(**tokenized_prompts, max_new_tokens=512)
259
+ print(tokenizer.decode(generation[0]))
260
+ >>> """<s>What are the roots of unity?
261
+
262
+ The roots of unity are the solutions to the equation $z^n = 1$, where $n$ is a positive integer.
263
+ These roots are complex numbers and they form a regular $n$-gon in the complex plane.
264
+
265
+ For example, the roots of unity for $n=1$ are just $1$,
266
+ and for $n=2$ they are $1$ and $-1$. For $n=3$, they are $1$, $\\frac{-1+\\sqrt{3}i}{2}$, and $\\frac{-1-\\sqrt{3}i}{2}$.
267
+
268
+ The roots of unity have many interesting properties and they are used in many areas of mathematics, including number theory, algebra, and geometry.</s>"""
269
+ ```
270
+
271
+ ## Evaluation
272
+ We evaluate Mathstral 7B and open-weight models of the similar size on industry-standard benchmarks.
273
+ | Benchmarks | MATH | GSM8K (8-shot) | Odyssey Math maj@16 | GRE Math maj@16 | AMC 2023 maj@16 | AIME 2024 maj@16 |
274
+ | --: | :-: | :-: | :--: |
275
+ | Mathstral 7B | **56.6** | 77.1 | **37.2** | 56.9 | **42.4** | **2/30** |
276
+ | DeepSeek Math 7B | 44.4 | **80.6** | 27.6 | 44.6 | 28.0 | 0/30 |
277
+ | Llama3 8B | 28.4 | 75.4 | 24.0 | 26.2 | 34.4 | 0/30 |
278
+ | GLM4 9B | 50.2 | 48.8 | 18.9 | 46.2 | 36.0 | 1/30 |
279
+ | QWen2 7B | **56.8** | 32.7 | 24.8 | **58.5** | 35.2 | **2/30** |
280
+ | Gemma2 9B | 48.3 | 69.5 | 18.6 | 52.3 | 31.2 | 1/30 |
281
+
282
+
283
+ ## The Mistral AI Team
284
+
285
+ 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, 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
286
+
287
+ <!-- original-model-card end -->