Views
No views yet
| Name | Quant method | Size |
|---|---|---|
| Mathstral-7B-v0.1.Q2_K.gguf | Q2_K | 2.54GB |
| Mathstral-7B-v0.1.IQ3_XS.gguf | IQ3_XS | 2.82GB |
| Mathstral-7B-v0.1.IQ3_S.gguf | IQ3_S | 2.97GB |
| Mathstral-7B-v0.1.Q3_K_S.gguf | Q3_K_S | 2.95GB |
| Mathstral-7B-v0.1.IQ3_M.gguf | IQ3_M | 3.06GB |
| Mathstral-7B-v0.1.Q3_K.gguf | Q3_K | 3.28GB |
| Mathstral-7B-v0.1.Q3_K_M.gguf | Q3_K_M | 3.28GB |
| Mathstral-7B-v0.1.Q3_K_L.gguf | Q3_K_L | 3.56GB |
| Mathstral-7B-v0.1.IQ4_XS.gguf | IQ4_XS | 3.68GB |
| Mathstral-7B-v0.1.Q4_0.gguf | Q4_0 | 3.83GB |
| Mathstral-7B-v0.1.IQ4_NL.gguf | IQ4_NL | 3.87GB |
| Mathstral-7B-v0.1.Q4_K_S.gguf | Q4_K_S | 3.86GB |
| Mathstral-7B-v0.1.Q4_K.gguf | Q4_K | 4.07GB |
| Mathstral-7B-v0.1.Q4_K_M.gguf | Q4_K_M | 4.07GB |
| Mathstral-7B-v0.1.Q4_1.gguf | Q4_1 | 4.24GB |
| Mathstral-7B-v0.1.Q5_0.gguf | Q5_0 | 4.66GB |
| Mathstral-7B-v0.1.Q5_K_S.gguf | Q5_K_S | 4.66GB |
| Mathstral-7B-v0.1.Q5_K.gguf | Q5_K | 4.78GB |
| Mathstral-7B-v0.1.Q5_K_M.gguf | Q5_K_M | 4.78GB |
| Mathstral-7B-v0.1.Q5_1.gguf | Q5_1 | 5.07GB |
| Mathstral-7B-v0.1.Q6_K.gguf | Q6_K | 5.54GB |
| Mathstral-7B-v0.1.Q8_0.gguf | Q8_0 | 7.17GB |
mistralai/Mathstral-7b-v0.1 with mistral-inferencepip install mistral_inference>=1.2.01from huggingface_hub import snapshot_download
2from pathlib import Path
3
4mistral_models_path = Path.home().joinpath('mistral_models', 'Mathstral-7b-v0.1')
5mistral_models_path.mkdir(parents=True, exist_ok=True)
6
7snapshot_download(repo_id="mistralai/Mathstral-7b-v0.1", allow_patterns=["params.json", "consolidated.safetensors", "tokenizer.model.v3"], local_dir=mistral_models_path)mistral_inference, a mistral-demo CLI command should be available in your environment.mistral-chat $HOME/mistral_models/Mathstral-7b-v0.1 --instruct --max_tokens 256transformerstransformers library, install the latest release with pip install --upgrade transformers and run, for instance:1from transformers import pipeline
2import torch
3
4checkpoint = "mistralai/Mathstral-7b-v0.1"
5pipe = pipeline("text-generation", checkpoint, device_map="auto", torch_dtype=torch.bfloat16)
6
7prompt = [{"role": "user", "content": "What are the roots of unity?"}]
8out = pipe(prompt, max_new_tokens = 512)
9
10print(out[0]['generated_text'][-1])
11>>> "{'role': 'assistant', 'content': ' The roots of unity are the complex numbers that satisfy the equation $z^n = 1$, where $n$ is a positive integer. These roots are evenly spaced around the unit circle in the complex plane, and they have a variety of interesting properties and applications in mathematics and physics.'}"1from transformers import AutoTokenizer, AutoModelForCausalLM
2import torch
3
4checkpoint = "mistralai/Mathstral-7b-v0.1"
5tokenizer = AutoTokenizer.from_pretrained(checkpoint)
6model = AutoModelForCausalLM.from_pretrained(checkpoint, device_map="auto", torch_dtype=torch.bfloat16)
7
8prompt = [{"role": "user", "content": "What are the roots of unity?"}]
9tokenized_prompt = tokenizer.apply_chat_template(prompt, add_generation_prompt=True, return_dict=True, return_tensors="pt").to(model.device)
10
11out = model.generate(**tokenized_prompt, max_new_tokens=512)
12tokenizer.decode(out[0])
13>>> '<s>[INST] What are the roots of unity?[/INST] The roots of unity are the complex numbers that satisfy the equation $z^n = 1$, where $n$ is a positive integer. These roots are evenly spaced around the unit circle in the complex plane, and they have a variety of interesting properties and applications in mathematics and physics.</s>'| Benchmarks | MATH | GSM8K (8-shot) | Odyssey Math maj@16 | GRE Math maj@16 | AMC 2023 maj@16 | AIME 2024 maj@16 |
|---|---|---|---|---|---|---|
| Mathstral 7B | 56.6 | 77.1 | 37.2 | 56.9 | 42.4 | 2/30 |
| DeepSeek Math 7B | 44.4 | 80.6 | 27.6 | 44.6 | 28.0 | 0/30 |
| Llama3 8B | 28.4 | 75.4 | 24.0 | 26.2 | 34.4 | 0/30 |
| GLM4 9B | 50.2 | 48.8 | 18.9 | 46.2 | 36.0 | 1/30 |
| QWen2 7B | 56.8 | 32.7 | 24.8 | 58.5 | 35.2 | 2/30 |
| Gemma2 9B | 48.3 | 69.5 | 18.6 | 52.3 | 31.2 | 1/30 |