kimleang123 commited on
Commit
b77a43f
·
verified ·
1 Parent(s): 2e8fd8e

Upload folder using huggingface_hub

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,167 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model:
3
+ - mistralai/Mistral-Nemo-Base-2407
4
+ license: apache-2.0
5
+ language:
6
+ - en
7
+ - fr
8
+ - de
9
+ - es
10
+ - it
11
+ - pt
12
+ - ru
13
+ - zh
14
+ - ja
15
+
16
+ extra_gated_description: If you want to learn more about how we process your personal data, please read our <a href="https://mistral.ai/terms/">Privacy Policy</a>.
17
+ tags:
18
+ - bnb-my-repo
19
+ ---
20
+ # mistralai/Mistral-Nemo-Base-2407 (Quantized)
21
+
22
+ ## Description
23
+ This model is a quantized version of the original model [`mistralai/Mistral-Nemo-Base-2407`](https://huggingface.co/mistralai/Mistral-Nemo-Base-2407).
24
+
25
+ It's quantized using the BitsAndBytes library to 4-bit using the [bnb-my-repo](https://huggingface.co/spaces/bnb-community/bnb-my-repo) space.
26
+
27
+ ## Quantization Details
28
+ - **Quantization Type**: int4
29
+ - **bnb_4bit_quant_type**: nf4
30
+ - **bnb_4bit_use_double_quant**: True
31
+ - **bnb_4bit_compute_dtype**: bfloat16
32
+ - **bnb_4bit_quant_storage**: uint8
33
+
34
+
35
+
36
+ # 📄 Original Model Information
37
+
38
+
39
+
40
+ # Model Card for Mistral-Nemo-Base-2407
41
+
42
+ 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.
43
+
44
+ For more details about this model please refer to our release [blog post](https://mistral.ai/news/mistral-nemo/).
45
+
46
+ ## Key features
47
+ - Released under the **Apache 2 License**
48
+ - Pre-trained and instructed versions
49
+ - Trained with a **128k context window**
50
+ - Trained on a large proportion of **multilingual and code data**
51
+ - Drop-in replacement of Mistral 7B
52
+
53
+ ## Model Architecture
54
+ Mistral Nemo is a transformer model, with the following architecture choices:
55
+ - **Layers:** 40
56
+ - **Dim:** 5,120
57
+ - **Head dim:** 128
58
+ - **Hidden dim:** 14,436
59
+ - **Activation Function:** SwiGLU
60
+ - **Number of heads:** 32
61
+ - **Number of kv-heads:** 8 (GQA)
62
+ - **Vocabulary size:** 2**17 ~= 128k
63
+ - **Rotary embeddings (theta = 1M)**
64
+
65
+ ## Metrics
66
+
67
+ ### Main Benchmarks
68
+
69
+ | Benchmark | Score |
70
+ | --- | --- |
71
+ | HellaSwag (0-shot) | 83.5% |
72
+ | Winogrande (0-shot) | 76.8% |
73
+ | OpenBookQA (0-shot) | 60.6% |
74
+ | CommonSenseQA (0-shot) | 70.4% |
75
+ | TruthfulQA (0-shot) | 50.3% |
76
+ | MMLU (5-shot) | 68.0% |
77
+ | TriviaQA (5-shot) | 73.8% |
78
+ | NaturalQuestions (5-shot) | 31.2% |
79
+
80
+ ### Multilingual Benchmarks (MMLU)
81
+
82
+ | Language | Score |
83
+ | --- | --- |
84
+ | French | 62.3% |
85
+ | German | 62.7% |
86
+ | Spanish | 64.6% |
87
+ | Italian | 61.3% |
88
+ | Portuguese | 63.3% |
89
+ | Russian | 59.2% |
90
+ | Chinese | 59.0% |
91
+ | Japanese | 59.0% |
92
+
93
+
94
+ ## Usage
95
+
96
+ The model can be used with three different frameworks
97
+
98
+ - [`mistral_inference`](https://github.com/mistralai/mistral-inference): See [here](#mistral-inference)
99
+ - [`transformers`](https://github.com/huggingface/transformers): See [here](#transformers)
100
+ - [`NeMo`](https://github.com/NVIDIA/NeMo): See [nvidia/Mistral-NeMo-12B-Base](https://huggingface.co/nvidia/Mistral-NeMo-12B-Base)
101
+
102
+
103
+ ### Mistral Inference
104
+
105
+
106
+ #### Install
107
+
108
+ It is recommended to use `mistralai/Mistral-Nemo-Base-2407` with [mistral-inference](https://github.com/mistralai/mistral-inference).
109
+ For HF transformers code snippets, please keep scrolling.
110
+
111
+ ```
112
+ pip install mistral_inference
113
+ ```
114
+
115
+ #### Download
116
+
117
+ ```py
118
+ from huggingface_hub import snapshot_download
119
+ from pathlib import Path
120
+
121
+ mistral_models_path = Path.home().joinpath('mistral_models', 'Nemo-v0.1')
122
+ mistral_models_path.mkdir(parents=True, exist_ok=True)
123
+
124
+ snapshot_download(repo_id="mistralai/Mistral-Nemo-Base-2407", allow_patterns=["params.json", "consolidated.safetensors", "tekken.json"], local_dir=mistral_models_path)
125
+ ```
126
+
127
+ #### Demo
128
+
129
+ After installing `mistral_inference`, a `mistral-demo` CLI command should be available in your environment.
130
+
131
+ ```
132
+ mistral-demo $HOME/mistral_models/Nemo-v0.1
133
+ ```
134
+
135
+ ### Transformers
136
+
137
+ > [!IMPORTANT]
138
+ > NOTE: Until a new release has been made, you need to install transformers from source:
139
+ > ```sh
140
+ > pip install git+https://github.com/huggingface/transformers.git
141
+ > ```
142
+
143
+ If you want to use Hugging Face `transformers` to generate text, you can do something like this.
144
+
145
+ ```py
146
+ from transformers import AutoModelForCausalLM, AutoTokenizer
147
+
148
+ model_id = "mistralai/Mistral-Nemo-Base-2407"
149
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
150
+
151
+ model = AutoModelForCausalLM.from_pretrained(model_id)
152
+ inputs = tokenizer("Hello my name is", return_tensors="pt")
153
+
154
+ outputs = model.generate(**inputs, max_new_tokens=20)
155
+ print(tokenizer.decode(outputs[0], skip_special_tokens=True))
156
+ ```
157
+
158
+ > [!TIP]
159
+ > Unlike previous Mistral models, Mistral Nemo requires smaller temperatures. We recommend to use a temperature of 0.3.
160
+
161
+ ## Note
162
+
163
+ `Mistral-Nemo-Base-2407` is a pretrained base model and therefore does not have any moderation mechanisms.
164
+
165
+ ## The Mistral AI Team
166
+
167
+ 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
config.json ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "mistralai/Mistral-Nemo-Base-2407",
3
+ "architectures": [
4
+ "MistralModel"
5
+ ],
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": 1,
8
+ "eos_token_id": 2,
9
+ "head_dim": 128,
10
+ "hidden_act": "silu",
11
+ "hidden_size": 5120,
12
+ "initializer_range": 0.02,
13
+ "intermediate_size": 14336,
14
+ "max_position_embeddings": 131072,
15
+ "model_type": "mistral",
16
+ "num_attention_heads": 32,
17
+ "num_hidden_layers": 40,
18
+ "num_key_value_heads": 8,
19
+ "quantization_config": {
20
+ "_load_in_4bit": true,
21
+ "_load_in_8bit": false,
22
+ "bnb_4bit_compute_dtype": "bfloat16",
23
+ "bnb_4bit_quant_storage": "uint8",
24
+ "bnb_4bit_quant_type": "nf4",
25
+ "bnb_4bit_use_double_quant": true,
26
+ "llm_int8_enable_fp32_cpu_offload": false,
27
+ "llm_int8_has_fp16_weight": false,
28
+ "llm_int8_skip_modules": null,
29
+ "llm_int8_threshold": 6.0,
30
+ "load_in_4bit": true,
31
+ "load_in_8bit": false,
32
+ "quant_method": "bitsandbytes"
33
+ },
34
+ "rms_norm_eps": 1e-05,
35
+ "rope_theta": 1000000.0,
36
+ "sliding_window": null,
37
+ "tie_word_embeddings": false,
38
+ "torch_dtype": "bfloat16",
39
+ "transformers_version": "4.49.0",
40
+ "use_cache": true,
41
+ "vocab_size": 131072
42
+ }
model-00001-of-00002.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:64b0c11d07e3b3a777371ddca43c4c2e590734598aed829d565467dad56b2ae3
3
+ size 4999742440
model-00002-of-00002.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cdc969f654c146e01bbc9f7e10402ba345d6baa5c43fa4061d161c82f64a1d9b
3
+ size 1969467932
model.safetensors.index.json ADDED
The diff for this file is too large to render. See raw diff
 
special_tokens_map.json ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<s>",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "eos_token": {
10
+ "content": "</s>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "unk_token": {
17
+ "content": "<unk>",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ }
23
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b0240ce510f08e6c2041724e9043e33be9d251d1e4a4d94eb68cd47b954b61d2
3
+ size 17078292
tokenizer_config.json ADDED
The diff for this file is too large to render. See raw diff