casualjim commited on
Commit
9720a03
1 Parent(s): 037e183

add awq q6_k version of the model

Browse files
README.md ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - fr
5
+ - it
6
+ - de
7
+ - es
8
+ - en
9
+ tags:
10
+ - moe
11
+ ---
12
+ # Model Card for Mixtral-8x7B
13
+ The Mixtral-8x7B Large Language Model (LLM) is a pretrained generative Sparse Mixture of Experts. The Mistral-8x7B outperforms Llama 2 70B on most benchmarks we tested.
14
+
15
+ For full details of this model please read our [release blog post](https://mistral.ai/news/mixtral-of-experts/).
16
+
17
+ ## Warning
18
+ This repo contains weights that are compatible with [vLLM](https://github.com/vllm-project/vllm) serving of the model as well as Hugging Face [transformers](https://github.com/huggingface/transformers) library. It is based on the original Mixtral [torrent release](magnet:?xt=urn:btih:5546272da9065eddeb6fcd7ffddeef5b75be79a7&dn=mixtral-8x7b-32kseqlen&tr=udp%3A%2F%http://2Fopentracker.i2p.rocks%3A6969%2Fannounce&tr=http%3A%2F%http://2Ftracker.openbittorrent.com%3A80%2Fannounce), but the file format and parameter names are different. Please note that model cannot (yet) be instantiated with HF.
19
+
20
+ ## Run the model
21
+
22
+
23
+ ```python
24
+ from transformers import AutoModelForCausalLM, AutoTokenizer
25
+
26
+ model_id = "mistralai/Mixtral-8x7B-v0.1"
27
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
28
+
29
+ model = AutoModelForCausalLM.from_pretrained(model_id)
30
+
31
+ text = "Hello my name is"
32
+ inputs = tokenizer(text, return_tensors="pt")
33
+
34
+ outputs = model.generate(**inputs, max_new_tokens=20)
35
+ print(tokenizer.decode(outputs[0], skip_special_tokens=True))
36
+ ```
37
+
38
+ By default, transformers will load the model in full precision. Therefore you might be interested to further reduce down the memory requirements to run the model through the optimizations we offer in HF ecosystem:
39
+
40
+ ### In half-precision
41
+
42
+ Note `float16` precision only works on GPU devices
43
+
44
+ <details>
45
+ <summary> Click to expand </summary>
46
+
47
+ ```diff
48
+ + import torch
49
+ from transformers import AutoModelForCausalLM, AutoTokenizer
50
+
51
+ model_id = "mistralai/Mixtral-8x7B-v0.1"
52
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
53
+
54
+ + model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.float16).to(0)
55
+
56
+ text = "Hello my name is"
57
+ + inputs = tokenizer(text, return_tensors="pt").to(0)
58
+
59
+ outputs = model.generate(**inputs, max_new_tokens=20)
60
+ print(tokenizer.decode(outputs[0], skip_special_tokens=True))
61
+ ```
62
+ </details>
63
+
64
+ ### Lower precision using (8-bit & 4-bit) using `bitsandbytes`
65
+
66
+ <details>
67
+ <summary> Click to expand </summary>
68
+
69
+ ```diff
70
+ + import torch
71
+ from transformers import AutoModelForCausalLM, AutoTokenizer
72
+
73
+ model_id = "mistralai/Mixtral-8x7B-v0.1"
74
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
75
+
76
+ + model = AutoModelForCausalLM.from_pretrained(model_id, load_in_4bit=True)
77
+
78
+ text = "Hello my name is"
79
+ + inputs = tokenizer(text, return_tensors="pt").to(0)
80
+
81
+ outputs = model.generate(**inputs, max_new_tokens=20)
82
+ print(tokenizer.decode(outputs[0], skip_special_tokens=True))
83
+ ```
84
+ </details>
85
+
86
+ ### Load the model with Flash Attention 2
87
+
88
+ <details>
89
+ <summary> Click to expand </summary>
90
+
91
+ ```diff
92
+ + import torch
93
+ from transformers import AutoModelForCausalLM, AutoTokenizer
94
+
95
+ model_id = "mistralai/Mixtral-8x7B-v0.1"
96
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
97
+
98
+ + model = AutoModelForCausalLM.from_pretrained(model_id, use_flash_attention_2=True)
99
+
100
+ text = "Hello my name is"
101
+ + inputs = tokenizer(text, return_tensors="pt").to(0)
102
+
103
+ outputs = model.generate(**inputs, max_new_tokens=20)
104
+ print(tokenizer.decode(outputs[0], skip_special_tokens=True))
105
+ ```
106
+ </details>
107
+
108
+ ## Notice
109
+ Mixtral-8x7B is a pretrained base model and therefore does not have any moderation mechanisms.
110
+
111
+ # The Mistral AI Team
112
+ Albert Jiang, Alexandre Sablayrolles, Arthur Mensch, Blanche Savary, Chris Bamford, Devendra Singh Chaplot, Diego de las Casas, Emma Bou Hanna, Florian Bressand, Gianna Lengyel, Guillaume Bour, Guillaume Lample, Lélio Renard Lavaud, Louis Ternon, Lucile Saulnier, Marie-Anne Lachaux, Pierre Stock, Teven Le Scao, Théophile Gervet, Thibaut Lavril, Thomas Wang, Timothée Lacroix, William El Sayed.
mistralai-mixtral-8x7B-v0.1_awq_q6_K.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c16ff97b1a8510779a050a85fa72efad8ad4c87c07a6d4b4c0268ee275a6f362
3
+ size 38378759552
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
The diff for this file is too large to render. See raw diff
 
tokenizer.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dadfd56d766715c61d2ef780a525ab43b8e6da4de6865bda3d95fdef5e134055
3
+ size 493443
tokenizer_config.json ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": true,
3
+ "add_eos_token": false,
4
+ "added_tokens_decoder": {
5
+ "0": {
6
+ "content": "<unk>",
7
+ "lstrip": false,
8
+ "normalized": false,
9
+ "rstrip": false,
10
+ "single_word": false,
11
+ "special": true
12
+ },
13
+ "1": {
14
+ "content": "<s>",
15
+ "lstrip": false,
16
+ "normalized": false,
17
+ "rstrip": false,
18
+ "single_word": false,
19
+ "special": true
20
+ },
21
+ "2": {
22
+ "content": "</s>",
23
+ "lstrip": false,
24
+ "normalized": false,
25
+ "rstrip": false,
26
+ "single_word": false,
27
+ "special": true
28
+ }
29
+ },
30
+ "additional_special_tokens": [],
31
+ "bos_token": "<s>",
32
+ "clean_up_tokenization_spaces": false,
33
+ "eos_token": "</s>",
34
+ "legacy": true,
35
+ "model_max_length": 1000000000000000019884624838656,
36
+ "pad_token": null,
37
+ "sp_model_kwargs": {},
38
+ "spaces_between_special_tokens": false,
39
+ "tokenizer_class": "LlamaTokenizer",
40
+ "unk_token": "<unk>",
41
+ "use_default_system_prompt": false
42
+ }