DrNicefellow commited on
Commit
1026bfc
1 Parent(s): d07d82c

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +8 -205
README.md CHANGED
@@ -1,220 +1,23 @@
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-Instruct-2407
16
 
17
- The Mistral-Nemo-Instruct-2407 Large Language Model (LLM) is an instruct fine-tuned version of the [Mistral-Nemo-Base-2407](https://huggingface.co/mistralai/Mistral-Nemo-Base-2407). 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
- - Trained on a large proportion of **multilingual and code data**
26
- - Drop-in replacement of Mistral 7B
27
 
28
- ## Model Architecture
29
- Mistral Nemo is a transformer model, with the following architecture choices:
30
- - **Layers:** 40
31
- - **Dim:** 5,120
32
- - **Head dim:** 128
33
- - **Hidden dim:** 14,436
34
- - **Activation Function:** SwiGLU
35
- - **Number of heads:** 32
36
- - **Number of kv-heads:** 8 (GQA)
37
- - **Vocabulary size:** 2**17 ~= 128k
38
- - **Rotary embeddings (theta = 1M)**
39
 
40
- ## Metrics
41
 
42
- ### Main Benchmarks
43
 
44
- | Benchmark | Score |
45
- | --- | --- |
46
- | HellaSwag (0-shot) | 83.5% |
47
- | Winogrande (0-shot) | 76.8% |
48
- | OpenBookQA (0-shot) | 60.6% |
49
- | CommonSenseQA (0-shot) | 70.4% |
50
- | TruthfulQA (0-shot) | 50.3% |
51
- | MMLU (5-shot) | 68.0% |
52
- | TriviaQA (5-shot) | 73.8% |
53
- | NaturalQuestions (5-shot) | 31.2% |
54
 
55
- ### Multilingual Benchmarks (MMLU)
56
 
57
- | Language | Score |
58
- | --- | --- |
59
- | French | 62.3% |
60
- | German | 62.7% |
61
- | Spanish | 64.6% |
62
- | Italian | 61.3% |
63
- | Portuguese | 63.3% |
64
- | Russian | 59.2% |
65
- | Chinese | 59.0% |
66
- | Japanese | 59.0% |
67
 
68
- ## Usage
69
 
70
- The model can be used with three different frameworks
71
-
72
- - [`mistral_inference`](https://github.com/mistralai/mistral-inference): See [here](https://huggingface.co/mistralai/Mistral-Nemo-Instruct-2407#mistral-inference)
73
- - [`transformers`](https://github.com/huggingface/transformers): See [here](#transformers)
74
- - [`NeMo`](https://github.com/NVIDIA/NeMo): See [nvidia/Mistral-NeMo-12B-Instruct](https://huggingface.co/nvidia/Mistral-NeMo-12B-Instruct)
75
-
76
- ### Mistral Inference
77
-
78
- #### Install
79
-
80
- It is recommended to use `mistralai/Mistral-Nemo-Instruct-2407` with [mistral-inference](https://github.com/mistralai/mistral-inference). For HF transformers code snippets, please keep scrolling.
81
-
82
- ```
83
- pip install mistral_inference
84
- ```
85
-
86
- #### Download
87
-
88
- ```py
89
- from huggingface_hub import snapshot_download
90
- from pathlib import Path
91
-
92
- mistral_models_path = Path.home().joinpath('mistral_models', 'Nemo-Instruct')
93
- mistral_models_path.mkdir(parents=True, exist_ok=True)
94
-
95
- snapshot_download(repo_id="mistralai/Mistral-Nemo-Instruct-2407", allow_patterns=["params.json", "consolidated.safetensors", "tekken.json"], local_dir=mistral_models_path)
96
- ```
97
-
98
- #### Chat
99
-
100
- After installing `mistral_inference`, a `mistral-chat` CLI command should be available in your environment. You can chat with the model using
101
-
102
- ```
103
- mistral-chat $HOME/mistral_models/Nemo-Instruct --instruct --max_tokens 256 --temperature 0.35
104
- ```
105
-
106
- *E.g.* Try out something like:
107
- ```
108
- How expensive would it be to ask a window cleaner to clean all windows in Paris. Make a reasonable guess in US Dollar.
109
- ```
110
-
111
- #### Instruct following
112
-
113
- ```py
114
- from mistral_inference.transformer import Transformer
115
- from mistral_inference.generate import generate
116
-
117
- from mistral_common.tokens.tokenizers.mistral import MistralTokenizer
118
- from mistral_common.protocol.instruct.messages import UserMessage
119
- from mistral_common.protocol.instruct.request import ChatCompletionRequest
120
-
121
- tokenizer = MistralTokenizer.from_file(f"{mistral_models_path}/tekken.json")
122
- model = Transformer.from_folder(mistral_models_path)
123
-
124
- prompt = "How expensive would it be to ask a window cleaner to clean all windows in Paris. Make a reasonable guess in US Dollar."
125
-
126
- completion_request = ChatCompletionRequest(messages=[UserMessage(content=prompt)])
127
-
128
- tokens = tokenizer.encode_chat_completion(completion_request).tokens
129
-
130
- out_tokens, _ = generate([tokens], model, max_tokens=64, temperature=0.35, eos_id=tokenizer.instruct_tokenizer.tokenizer.eos_id)
131
- result = tokenizer.decode(out_tokens[0])
132
-
133
- print(result)
134
- ```
135
-
136
- #### Function calling
137
-
138
- ```py
139
- from mistral_common.protocol.instruct.tool_calls import Function, Tool
140
- from mistral_inference.transformer import Transformer
141
- from mistral_inference.generate import generate
142
-
143
- from mistral_common.tokens.tokenizers.mistral import MistralTokenizer
144
- from mistral_common.protocol.instruct.messages import UserMessage
145
- from mistral_common.protocol.instruct.request import ChatCompletionRequest
146
-
147
-
148
- tokenizer = MistralTokenizer.from_file(f"{mistral_models_path}/tekken.json")
149
- model = Transformer.from_folder(mistral_models_path)
150
-
151
- completion_request = ChatCompletionRequest(
152
- tools=[
153
- Tool(
154
- function=Function(
155
- name="get_current_weather",
156
- description="Get the current weather",
157
- parameters={
158
- "type": "object",
159
- "properties": {
160
- "location": {
161
- "type": "string",
162
- "description": "The city and state, e.g. San Francisco, CA",
163
- },
164
- "format": {
165
- "type": "string",
166
- "enum": ["celsius", "fahrenheit"],
167
- "description": "The temperature unit to use. Infer this from the users location.",
168
- },
169
- },
170
- "required": ["location", "format"],
171
- },
172
- )
173
- )
174
- ],
175
- messages=[
176
- UserMessage(content="What's the weather like today in Paris?"),
177
- ],
178
- )
179
-
180
- tokens = tokenizer.encode_chat_completion(completion_request).tokens
181
-
182
- out_tokens, _ = generate([tokens], model, max_tokens=256, temperature=0.35, eos_id=tokenizer.instruct_tokenizer.tokenizer.eos_id)
183
- result = tokenizer.decode(out_tokens[0])
184
-
185
- print(result)
186
- ```
187
-
188
- ### Transformers
189
-
190
- > [!IMPORTANT]
191
- > NOTE: Until a new release has been made, you need to install transformers from source:
192
- > ```sh
193
- > pip install git+https://github.com/huggingface/transformers.git
194
- > ```
195
-
196
- If you want to use Hugging Face `transformers` to generate text, you can do something like this.
197
-
198
- ```py
199
- from transformers import pipeline
200
-
201
- messages = [
202
- {"role": "system", "content": "You are a pirate chatbot who always responds in pirate speak!"},
203
- {"role": "user", "content": "Who are you?"},
204
- ]
205
- chatbot = pipeline("text-generation", model="mistralai/Mistral-Nemo-Instruct-2407")
206
- chatbot(messages)
207
- ```
208
-
209
- > [!TIP]
210
- > Unlike previous Mistral models, Mistral Nemo requires smaller temperatures. We recommend to use a temperature of 0.3.
211
-
212
- ## Limitations
213
-
214
- The Mistral Nemo Instruct model is a quick demonstration that the base model can be easily fine-tuned to achieve compelling performance.
215
- It does not have any moderation mechanisms. We're looking forward to engaging with the community on ways to
216
- make the model finely respect guardrails, allowing for deployment in environments requiring moderated outputs.
217
-
218
- ## The Mistral AI Team
219
-
220
- 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
 
1
  ---
2
  license: apache-2.0
 
 
 
 
 
 
 
 
 
 
3
  ---
4
+ # mistralai_Mistral-Nemo-Instruct-2407-exl2-5bpw
5
 
 
6
 
7
+ This is a 45.0bpw quantized version of [mistralai/Mistral-Nemo-Instruct-2407](https://huggingface.co/mistralai/Mistral-Nemo-Instruct-2407) made with [exllamav2](https://github.com/turboderp/exllamav2).
8
 
 
9
 
10
+ ## License
 
 
 
 
 
11
 
12
+ This model is available under the Apache 2.0 License.
 
 
 
 
 
 
 
 
 
 
13
 
 
14
 
15
+ ## Discord Server
16
 
17
+ Join our Discord server [here](https://discord.gg/xhcBDEM3).
 
 
 
 
 
 
 
 
 
18
 
 
19
 
20
+ ## Feeling Generous? 😊
 
 
 
 
 
 
 
 
 
21
 
22
+ Eager to buy me a cup of 2$ coffe or iced tea?🍵☕ Sure, here is the link: [https://ko-fi.com/drnicefellow](https://ko-fi.com/drnicefellow). Please add a note on which one you want me to drink?
23