Files changed (1) hide show
  1. README.md +120 -3
README.md CHANGED
@@ -1,3 +1,120 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ - fr
6
+ - de
7
+ - es
8
+ - it
9
+ - pt
10
+ - ru
11
+ - zh
12
+ - ja
13
+ ---
14
+
15
+ # Model Card for Mistral-Nemo-Base-v0.1
16
+
17
+ The Mistral-Nemo-Base-v0.1 Large Language Model (LLM) is a pretrained generative text model of 12B parameters trained jointly by Mistral AI and Nvidia, it significantly outperforms existing models smaller or similar in size.
18
+
19
+ For more details about this model please refer to our release [blog post](https://mistral.ai/news/mistral-nemo/).
20
+
21
+ ## Key features
22
+ - Released under the **Apache 2 License**
23
+ - Pre-trained and instructed versions
24
+ - Trained with a **128k context window**
25
+ - Comes with a **FP8 quantized version with no accuracy loss**
26
+ - Trained on a large proportion of **multilingual and code data**
27
+ - Drop-in replacement of Mistral 7B
28
+
29
+ ## Model Architecture
30
+ Mistral Nemo is a transformer model, with the following architecture choices:
31
+ - **Layers:** 40
32
+ - **Dim:** 5,120
33
+ - **Head dim:** 128
34
+ - **Hidden dim:** 14,436
35
+ - **Activation Function:** SwiGLU
36
+ - **Number of heads:** 32
37
+ - **Number of kv-heads:** 8 (GQA)
38
+ - **Vocabulary size:** 2**17 ~= 128k
39
+ - **Rotary embeddings (theta = 1M)**
40
+
41
+ ## Metrics
42
+
43
+ ### Main Benchmarks
44
+
45
+ | Benchmark | Score |
46
+ | --- | --- |
47
+ | HellaSwag (0-shot) | 83.5% |
48
+ | Winogrande (0-shot) | 76.8% |
49
+ | OpenBookQA (0-shot) | 60.6% |
50
+ | CommonSenseQA (0-shot) | 70.4% |
51
+ | TruthfulQA (0-shot) | 50.3% |
52
+ | MMLU (5-shot) | 68.0% |
53
+ | TriviaQA (5-shot) | 73.8% |
54
+ | NaturalQuestions (5-shot) | 31.2% |
55
+
56
+ ### Multilingual Benchmarks (MMLU)
57
+
58
+ | Language | Score |
59
+ | --- | --- |
60
+ | French | 62.3% |
61
+ | German | 62.7% |
62
+ | Spanish | 64.6% |
63
+ | Italian | 61.3% |
64
+ | Portuguese | 63.3% |
65
+ | Russian | 59.2% |
66
+ | Chinese | 59.0% |
67
+ | Japanese | 59.0% |
68
+
69
+ ## Installation with `mistral_inference`
70
+
71
+ It is recommended to use `mistralai/Mistral-Nemo-Base-v0.1` with [mistral-inference](https://github.com/mistralai/mistral-inference). For HF transformers code snippets, please keep scrolling.
72
+
73
+ ```
74
+ pip install mistral_inference
75
+ ```
76
+
77
+ ## Download
78
+
79
+ ```py
80
+ from huggingface_hub import snapshot_download
81
+ from pathlib import Path
82
+
83
+ mistral_models_path = Path.home().joinpath('mistral_models', 'Nemo-v0.1')
84
+ mistral_models_path.mkdir(parents=True, exist_ok=True)
85
+
86
+ snapshot_download(repo_id="mistralai/Mistral-Nemo-Base-v0.1", allow_patterns=["params.json", "consolidated.safetensors", "tekken.json"], local_dir=mistral_models_path)
87
+ ```
88
+
89
+ ### Demo
90
+
91
+ After installing `mistral_inference`, a `mistral-demo` CLI command should be available in your environment.
92
+
93
+ ```
94
+ mistral-demo $HOME/mistral_models/Nemo-v0.1
95
+ ```
96
+
97
+ ## Generate with `transformers`
98
+
99
+ If you want to use Hugging Face `transformers` to generate text, you can do something like this.
100
+
101
+ ```py
102
+ from transformers import AutoModelForCausalLM, AutoTokenizer
103
+
104
+ model_id = "mistralai/Mistral-Nemo-Base-v0.1"
105
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
106
+
107
+ model = AutoModelForCausalLM.from_pretrained(model_id)
108
+ inputs = tokenizer("Hello my name is", return_tensors="pt")
109
+
110
+ outputs = model.generate(**inputs, max_new_tokens=20)
111
+ print(tokenizer.decode(outputs[0], skip_special_tokens=True))
112
+ ```
113
+
114
+ ## Note
115
+
116
+ Mistral-Nemo-Base-v0.1 is a pretrained base model and therefore does not have any moderation mechanisms.
117
+
118
+ ## The Mistral AI Team
119
+
120
+ 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