Triangle104
commited on
Commit
•
c0b3f6b
1
Parent(s):
152c5ed
Update README.md
Browse files
README.md
CHANGED
@@ -22,6 +22,117 @@ tags:
|
|
22 |
This model was converted to GGUF format from [`mistralai/Mistral-Nemo-Base-2407`](https://huggingface.co/mistralai/Mistral-Nemo-Base-2407) using llama.cpp via the ggml.ai's [GGUF-my-repo](https://huggingface.co/spaces/ggml-org/gguf-my-repo) space.
|
23 |
Refer to the [original model card](https://huggingface.co/mistralai/Mistral-Nemo-Base-2407) for more details on the model.
|
24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
## Use with llama.cpp
|
26 |
Install llama.cpp through brew (works on Mac and Linux)
|
27 |
|
|
|
22 |
This model was converted to GGUF format from [`mistralai/Mistral-Nemo-Base-2407`](https://huggingface.co/mistralai/Mistral-Nemo-Base-2407) using llama.cpp via the ggml.ai's [GGUF-my-repo](https://huggingface.co/spaces/ggml-org/gguf-my-repo) space.
|
23 |
Refer to the [original model card](https://huggingface.co/mistralai/Mistral-Nemo-Base-2407) for more details on the model.
|
24 |
|
25 |
+
---
|
26 |
+
Model details:
|
27 |
+
-
|
28 |
+
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.
|
29 |
+
|
30 |
+
For more details about this model please refer to our release blog post.
|
31 |
+
|
32 |
+
Key features
|
33 |
+
-
|
34 |
+
Released under the Apache 2 License
|
35 |
+
Pre-trained and instructed versions
|
36 |
+
Trained with a 128k context window
|
37 |
+
Trained on a large proportion of multilingual and code data
|
38 |
+
Drop-in replacement of Mistral 7B
|
39 |
+
|
40 |
+
Model Architecture
|
41 |
+
-
|
42 |
+
Mistral Nemo is a transformer model, with the following architecture choices:
|
43 |
+
|
44 |
+
Layers: 40
|
45 |
+
Dim: 5,120
|
46 |
+
Head dim: 128
|
47 |
+
Hidden dim: 14,436
|
48 |
+
Activation Function: SwiGLU
|
49 |
+
Number of heads: 32
|
50 |
+
Number of kv-heads: 8 (GQA)
|
51 |
+
Vocabulary size: 2**17 ~= 128k
|
52 |
+
Rotary embeddings (theta = 1M)
|
53 |
+
|
54 |
+
Metrics
|
55 |
+
Main Benchmarks
|
56 |
+
Benchmark Score
|
57 |
+
HellaSwag (0-shot) 83.5%
|
58 |
+
Winogrande (0-shot) 76.8%
|
59 |
+
OpenBookQA (0-shot) 60.6%
|
60 |
+
CommonSenseQA (0-shot) 70.4%
|
61 |
+
TruthfulQA (0-shot) 50.3%
|
62 |
+
MMLU (5-shot) 68.0%
|
63 |
+
TriviaQA (5-shot) 73.8%
|
64 |
+
NaturalQuestions (5-shot) 31.2%
|
65 |
+
Multilingual Benchmarks (MMLU)
|
66 |
+
Language Score
|
67 |
+
French 62.3%
|
68 |
+
German 62.7%
|
69 |
+
Spanish 64.6%
|
70 |
+
Italian 61.3%
|
71 |
+
Portuguese 63.3%
|
72 |
+
Russian 59.2%
|
73 |
+
Chinese 59.0%
|
74 |
+
Japanese 59.0%
|
75 |
+
Usage
|
76 |
+
|
77 |
+
The model can be used with three different frameworks
|
78 |
+
|
79 |
+
mistral_inference: See here
|
80 |
+
transformers: See here
|
81 |
+
NeMo: See nvidia/Mistral-NeMo-12B-Base
|
82 |
+
|
83 |
+
Mistral Inference
|
84 |
+
-
|
85 |
+
Install
|
86 |
+
-
|
87 |
+
It is recommended to use mistralai/Mistral-Nemo-Base-2407 with mistral-inference. For HF transformers code snippets, please keep scrolling.
|
88 |
+
|
89 |
+
pip install mistral_inference
|
90 |
+
|
91 |
+
Download
|
92 |
+
-
|
93 |
+
from huggingface_hub import snapshot_download
|
94 |
+
from pathlib import Path
|
95 |
+
|
96 |
+
mistral_models_path = Path.home().joinpath('mistral_models', 'Nemo-v0.1')
|
97 |
+
mistral_models_path.mkdir(parents=True, exist_ok=True)
|
98 |
+
|
99 |
+
snapshot_download(repo_id="mistralai/Mistral-Nemo-Base-2407", allow_patterns=["params.json", "consolidated.safetensors", "tekken.json"], local_dir=mistral_models_path)
|
100 |
+
|
101 |
+
Demo
|
102 |
+
-
|
103 |
+
After installing mistral_inference, a mistral-demo CLI command should be available in your environment.
|
104 |
+
|
105 |
+
mistral-demo $HOME/mistral_models/Nemo-v0.1
|
106 |
+
|
107 |
+
Transformers
|
108 |
+
-
|
109 |
+
NOTE: Until a new release has been made, you need to install transformers from source:
|
110 |
+
|
111 |
+
pip install git+https://github.com/huggingface/transformers.git
|
112 |
+
|
113 |
+
If you want to use Hugging Face transformers to generate text, you can do something like this.
|
114 |
+
|
115 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
116 |
+
|
117 |
+
model_id = "mistralai/Mistral-Nemo-Base-2407"
|
118 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
119 |
+
|
120 |
+
model = AutoModelForCausalLM.from_pretrained(model_id)
|
121 |
+
inputs = tokenizer("Hello my name is", return_tensors="pt")
|
122 |
+
|
123 |
+
outputs = model.generate(**inputs, max_new_tokens=20)
|
124 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
125 |
+
|
126 |
+
Unlike previous Mistral models, Mistral Nemo requires smaller temperatures. We recommend to use a temperature of 0.3.
|
127 |
+
|
128 |
+
Note
|
129 |
+
-
|
130 |
+
Mistral-Nemo-Base-2407 is a pretrained base model and therefore does not have any moderation mechanisms.
|
131 |
+
The Mistral AI Team
|
132 |
+
|
133 |
+
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
|
134 |
+
|
135 |
+
---
|
136 |
## Use with llama.cpp
|
137 |
Install llama.cpp through brew (works on Mac and Linux)
|
138 |
|