gromdimon commited on
Commit
df71958
·
verified ·
1 Parent(s): c002e08

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +5 -109
README.md CHANGED
@@ -8,114 +8,10 @@ tags:
8
  - art
9
  ---
10
 
11
- # Model Card for beLLM
12
- The Mixtral-8x7B Large Language Model (LLM) is a pretrained generative Sparse Mixture of Experts. The Mixtral-8x7B outperforms Llama 2 70B on most benchmarks we tested.
13
 
14
- For full details of this model please read our [release blog post](https://mistral.ai/news/mixtral-of-experts/).
 
 
15
 
16
- ## Warning
17
- 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.
18
-
19
- ## Instruction format
20
-
21
- This format must be strictly respected, otherwise the model will generate sub-optimal outputs.
22
-
23
- The template used to build a prompt for the Instruct model is defined as follows:
24
- ```
25
- <s> [INST] Instruction [/INST] Model answer</s> [INST] Follow-up instruction [/INST]
26
- ```
27
- Note that `<s>` and `</s>` are special tokens for beginning of string (BOS) and end of string (EOS) while [INST] and [/INST] are regular strings.
28
-
29
- As reference, here is the pseudo-code used to tokenize instructions during fine-tuning:
30
- ```python
31
- def tokenize(text):
32
- return tok.encode(text, add_special_tokens=False)
33
- [BOS_ID] +
34
- tokenize("[INST]") + tokenize(USER_MESSAGE_1) + tokenize("[/INST]") +
35
- tokenize(BOT_MESSAGE_1) + [EOS_ID] +
36
-
37
- tokenize("[INST]") + tokenize(USER_MESSAGE_N) + tokenize("[/INST]") +
38
- tokenize(BOT_MESSAGE_N) + [EOS_ID]
39
- ```
40
-
41
- In the pseudo-code above, note that the `tokenize` method should not add a BOS or EOS token automatically, but should add a prefix space.
42
-
43
- ## Run the model
44
-
45
- ```python
46
- from transformers import AutoModelForCausalLM, AutoTokenizer
47
- model_id = "mistralai/Mixtral-8x7B-Instruct-v0.1"
48
- tokenizer = AutoTokenizer.from_pretrained(model_id)
49
- model = AutoModelForCausalLM.from_pretrained(model_id)
50
- text = "Hello my name is"
51
- inputs = tokenizer(text, return_tensors="pt")
52
- outputs = model.generate(**inputs, max_new_tokens=20)
53
- print(tokenizer.decode(outputs[0], skip_special_tokens=True))
54
- ```
55
-
56
- 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:
57
-
58
- ### In half-precision
59
-
60
- Note `float16` precision only works on GPU devices
61
-
62
- <details>
63
- <summary> Click to expand </summary>
64
-
65
- ```diff
66
- + import torch
67
- from transformers import AutoModelForCausalLM, AutoTokenizer
68
- model_id = "mistralai/Mixtral-8x7B-Instruct-v0.1"
69
- tokenizer = AutoTokenizer.from_pretrained(model_id)
70
- + model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.float16).to(0)
71
- text = "Hello my name is"
72
- + inputs = tokenizer(text, return_tensors="pt").to(0)
73
- outputs = model.generate(**inputs, max_new_tokens=20)
74
- print(tokenizer.decode(outputs[0], skip_special_tokens=True))
75
- ```
76
- </details>
77
-
78
- ### Lower precision using (8-bit & 4-bit) using `bitsandbytes`
79
-
80
- <details>
81
- <summary> Click to expand </summary>
82
-
83
- ```diff
84
- + import torch
85
- from transformers import AutoModelForCausalLM, AutoTokenizer
86
- model_id = "mistralai/Mixtral-8x7B-Instruct-v0.1"
87
- tokenizer = AutoTokenizer.from_pretrained(model_id)
88
- + model = AutoModelForCausalLM.from_pretrained(model_id, load_in_4bit=True)
89
- text = "Hello my name is"
90
- + inputs = tokenizer(text, return_tensors="pt").to(0)
91
- outputs = model.generate(**inputs, max_new_tokens=20)
92
- print(tokenizer.decode(outputs[0], skip_special_tokens=True))
93
- ```
94
- </details>
95
-
96
- ### Load the model with Flash Attention 2
97
-
98
- <details>
99
- <summary> Click to expand </summary>
100
-
101
- ```diff
102
- + import torch
103
- from transformers import AutoModelForCausalLM, AutoTokenizer
104
- model_id = "mistralai/Mixtral-8x7B-Instruct-v0.1"
105
- tokenizer = AutoTokenizer.from_pretrained(model_id)
106
- + model = AutoModelForCausalLM.from_pretrained(model_id, use_flash_attention_2=True)
107
- text = "Hello my name is"
108
- + inputs = tokenizer(text, return_tensors="pt").to(0)
109
- outputs = model.generate(**inputs, max_new_tokens=20)
110
- print(tokenizer.decode(outputs[0], skip_special_tokens=True))
111
- ```
112
- </details>
113
-
114
- ## Limitations
115
-
116
- The Mixtral-8x7B Instruct model is a quick demonstration that the base model can be easily fine-tuned to achieve compelling performance.
117
- It does not have any moderation mechanisms. We're looking forward to engaging with the community on ways to
118
- make the model finely respect guardrails, allowing for deployment in environments requiring moderated outputs.
119
-
120
- # The Mistral AI Team
121
- 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.
 
8
  - art
9
  ---
10
 
11
+ # beLLM
 
12
 
13
+ The beLLM or `belarusian Large Language Model (LLM)` is a pretrained generative language model for the Belarusian language. It is based on the previous work
14
+ of [RuPoemGPT](https://github.com/gromdimon/ml-random/tree/master/rupoemgpt). The model was trained on a collection of belarusian poems and prose, which
15
+ were collected from different sources.
16
 
17
+ For more information about beLLM, please refer to [github-repo](https://github.com/gromdimon/beLLM)