Kearm commited on
Commit
521f41c
1 Parent(s): 50c13bd

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +133 -3
README.md CHANGED
@@ -1,3 +1,133 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ datasets:
4
+ - cognitivecomputations/Dolphin-2.9
5
+ language:
6
+ - fr
7
+ - it
8
+ - de
9
+ - es
10
+ - en
11
+ tags:
12
+ - moe
13
+ ---
14
+ # WukongV2-Mixtral-8x7B-V0.1
15
+
16
+ ![image/jpeg](https://cdn-uploads.huggingface.co/production/uploads/655dc641accde1bbc8b41aec/xOe1Nb3S9Nb53us7_Ja3s.jpeg)
17
+
18
+
19
+ Join Our Discord! https://discord.gg/cognitivecomputations
20
+
21
+ WukongV2-Mixtral-8x7B-V0.1 is a dealigned and retrained chat finetune of the original mistralai/Mixtral-8x7B-v0.1 base model by the fantatsic Mistral team.
22
+
23
+ This model was trained on a selection of datasets from Cognitive Computations Dolphin 2.9 https://erichartford.com/dolphin 🐬
24
+
25
+ This model was trained for 3 epochs.
26
+
27
+ # Example Outputs
28
+
29
+ TBD
30
+
31
+ # Original Model Card Below
32
+
33
+ # Model Card for Mixtral-8x7B
34
+ 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.
35
+
36
+ For full details of this model please read our [release blog post](https://mistral.ai/news/mixtral-of-experts/).
37
+
38
+ ## Warning
39
+ 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.
40
+
41
+ ## Run the model
42
+
43
+
44
+ ```python
45
+ from transformers import AutoModelForCausalLM, AutoTokenizer
46
+
47
+ model_id = "mistralai/Mixtral-8x7B-v0.1"
48
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
49
+
50
+ model = AutoModelForCausalLM.from_pretrained(model_id)
51
+
52
+ text = "Hello my name is"
53
+ inputs = tokenizer(text, return_tensors="pt")
54
+
55
+ outputs = model.generate(**inputs, max_new_tokens=20)
56
+ print(tokenizer.decode(outputs[0], skip_special_tokens=True))
57
+ ```
58
+
59
+ 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:
60
+
61
+ ### In half-precision
62
+
63
+ Note `float16` precision only works on GPU devices
64
+
65
+ <details>
66
+ <summary> Click to expand </summary>
67
+
68
+ ```diff
69
+ + import torch
70
+ from transformers import AutoModelForCausalLM, AutoTokenizer
71
+
72
+ model_id = "mistralai/Mixtral-8x7B-v0.1"
73
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
74
+
75
+ + model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.float16).to(0)
76
+
77
+ text = "Hello my name is"
78
+ + inputs = tokenizer(text, return_tensors="pt").to(0)
79
+
80
+ outputs = model.generate(**inputs, max_new_tokens=20)
81
+ print(tokenizer.decode(outputs[0], skip_special_tokens=True))
82
+ ```
83
+ </details>
84
+
85
+ ### Lower precision using (8-bit & 4-bit) using `bitsandbytes`
86
+
87
+ <details>
88
+ <summary> Click to expand </summary>
89
+
90
+ ```diff
91
+ + import torch
92
+ from transformers import AutoModelForCausalLM, AutoTokenizer
93
+
94
+ model_id = "mistralai/Mixtral-8x7B-v0.1"
95
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
96
+
97
+ + model = AutoModelForCausalLM.from_pretrained(model_id, load_in_4bit=True)
98
+
99
+ text = "Hello my name is"
100
+ + inputs = tokenizer(text, return_tensors="pt").to(0)
101
+
102
+ outputs = model.generate(**inputs, max_new_tokens=20)
103
+ print(tokenizer.decode(outputs[0], skip_special_tokens=True))
104
+ ```
105
+ </details>
106
+
107
+ ### Load the model with Flash Attention 2
108
+
109
+ <details>
110
+ <summary> Click to expand </summary>
111
+
112
+ ```diff
113
+ + import torch
114
+ from transformers import AutoModelForCausalLM, AutoTokenizer
115
+
116
+ model_id = "mistralai/Mixtral-8x7B-v0.1"
117
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
118
+
119
+ + model = AutoModelForCausalLM.from_pretrained(model_id, use_flash_attention_2=True)
120
+
121
+ text = "Hello my name is"
122
+ + inputs = tokenizer(text, return_tensors="pt").to(0)
123
+
124
+ outputs = model.generate(**inputs, max_new_tokens=20)
125
+ print(tokenizer.decode(outputs[0], skip_special_tokens=True))
126
+ ```
127
+ </details>
128
+
129
+ ## Notice
130
+ Mixtral-8x7B is a pretrained base model and therefore does not have any moderation mechanisms.
131
+
132
+ # The Mistral AI Team
133
+ 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.