Safetensors
mistral
xzuyn commited on
Commit
c3f4ff5
·
verified ·
1 Parent(s): a6a8c18

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +143 -0
README.md ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ base_model: mistralai/Mistral-Nemo-Base-2407
14
+ ---
15
+
16
+ # Model Card for Mistral-Nemo-Base-2407
17
+
18
+ The Mistral-Nemo-Base-2407 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.
19
+
20
+ For more details about this model please refer to our release [blog post](https://mistral.ai/news/mistral-nemo/).
21
+
22
+ ## Key features
23
+ - Released under the **Apache 2 License**
24
+ - Pre-trained and instructed versions
25
+ - Trained with a **128k context window**
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
+
70
+ ## Usage
71
+
72
+ The model can be used with three different frameworks
73
+
74
+ - [`mistral_inference`](https://github.com/mistralai/mistral-inference): See [here](#mistral-inference)
75
+ - [`transformers`](https://github.com/huggingface/transformers): See [here](#transformers)
76
+ - [`NeMo`](https://github.com/NVIDIA/NeMo): See [nvidia/Mistral-NeMo-12B-Base](https://huggingface.co/nvidia/Mistral-NeMo-12B-Base)
77
+
78
+
79
+ ### Mistral Inference
80
+
81
+
82
+ #### Install
83
+
84
+ It is recommended to use `mistralai/Mistral-Nemo-Base-2407` with [mistral-inference](https://github.com/mistralai/mistral-inference).
85
+ For HF transformers code snippets, please keep scrolling.
86
+
87
+ ```
88
+ pip install mistral_inference
89
+ ```
90
+
91
+ #### Download
92
+
93
+ ```py
94
+ from huggingface_hub import snapshot_download
95
+ from pathlib import Path
96
+
97
+ mistral_models_path = Path.home().joinpath('mistral_models', 'Nemo-v0.1')
98
+ mistral_models_path.mkdir(parents=True, exist_ok=True)
99
+
100
+ snapshot_download(repo_id="mistralai/Mistral-Nemo-Base-2407", allow_patterns=["params.json", "consolidated.safetensors", "tekken.json"], local_dir=mistral_models_path)
101
+ ```
102
+
103
+ #### Demo
104
+
105
+ After installing `mistral_inference`, a `mistral-demo` CLI command should be available in your environment.
106
+
107
+ ```
108
+ mistral-demo $HOME/mistral_models/Nemo-v0.1
109
+ ```
110
+
111
+ ### Transformers
112
+
113
+ > [!IMPORTANT]
114
+ > NOTE: Until a new release has been made, you need to install transformers from source:
115
+ > ```sh
116
+ > pip install git+https://github.com/huggingface/transformers.git
117
+ > ```
118
+
119
+ If you want to use Hugging Face `transformers` to generate text, you can do something like this.
120
+
121
+ ```py
122
+ from transformers import AutoModelForCausalLM, AutoTokenizer
123
+
124
+ model_id = "mistralai/Mistral-Nemo-Base-2407"
125
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
126
+
127
+ model = AutoModelForCausalLM.from_pretrained(model_id)
128
+ inputs = tokenizer("Hello my name is", return_tensors="pt")
129
+
130
+ outputs = model.generate(**inputs, max_new_tokens=20)
131
+ print(tokenizer.decode(outputs[0], skip_special_tokens=True))
132
+ ```
133
+
134
+ > [!TIP]
135
+ > Unlike previous Mistral models, Mistral Nemo requires smaller temperatures. We recommend to use a temperature of 0.3.
136
+
137
+ ## Note
138
+
139
+ `Mistral-Nemo-Base-2407` is a pretrained base model and therefore does not have any moderation mechanisms.
140
+
141
+ ## The Mistral AI Team
142
+
143
+ 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