koesn commited on
Commit
313a4ee
1 Parent(s): 4633d10

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +107 -0
README.md CHANGED
@@ -1,3 +1,110 @@
1
  ---
2
  license: apache-2.0
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: apache-2.0
3
+ pipeline_tag: text-generation
4
+ tags:
5
+ - finetuned
6
+ inference: false
7
  ---
8
+
9
+ ## Description
10
+ This repo contains GGUF format model files for Mistral-7B-Instruct-v0.2.
11
+
12
+ ## Files Provided
13
+ | Name | Quant | Bits | File Size | Remark |
14
+ | ------------------------------------- | ------- | ---- | --------- | -------------------------------- |
15
+ | mistral-7b-instruct-v0.2.IQ3_XXS.gguf | IQ3_XXS | 3 | 3.02 GB | 3.06 bpw quantization |
16
+ | mistral-7b-instruct-v0.2.IQ3_S.gguf | IQ3_S | 3 | 3.18 GB | 3.44 bpw quantization |
17
+ | mistral-7b-instruct-v0.2.IQ3_M.gguf | IQ3_M | 3 | 3.28 GB | 3.66 bpw quantization mix |
18
+ | mistral-7b-instruct-v0.2.Q4_0.gguf | Q4_0 | 4 | 4.11 GB | 3.56G, +0.2166 ppl |
19
+ | mistral-7b-instruct-v0.2.IQ4_NL.gguf | IQ4_NL | 4 | 4.16 GB | 4.25 bpw non-linear quantization |
20
+ | mistral-7b-instruct-v0.2.Q4_K_M.gguf | Q4_K_M | 4 | 4.37 GB | 3.80G, +0.0532 ppl |
21
+ | mistral-7b-instruct-v0.2.Q5_K_M.gguf | Q5_K_M | 5 | 5.13 GB | 4.45G, +0.0122 ppl |
22
+ | mistral-7b-instruct-v0.2.Q6_K.gguf | Q6_K | 6 | 5.94 GB | 5.15G, +0.0008 ppl |
23
+ | mistral-7b-instruct-v0.2.Q8_0.gguf | Q8_0 | 8 | 7.70 GB | 6.70G, +0.0004 ppl |
24
+
25
+ ## Parameters
26
+ | path | type | architecture | rope_theta | sliding_win | max_pos_embed |
27
+ | ---------------------------------- | ------- | ------------------ | ---------- | ----------- | ------------- |
28
+ | mistralai/Mistral-7B-Instruct-v0.2 | mistral | MistralForCausalLM | 1000000.0 | null | 32768 |
29
+
30
+
31
+ # Original Model Card
32
+
33
+
34
+ # Model Card for Mistral-7B-Instruct-v0.2
35
+
36
+ The Mistral-7B-Instruct-v0.2 Large Language Model (LLM) is an improved instruct fine-tuned version of [Mistral-7B-Instruct-v0.1](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.1).
37
+
38
+ For full details of this model please read our [paper](https://arxiv.org/abs/2310.06825) and [release blog post](https://mistral.ai/news/la-plateforme/).
39
+
40
+ ## Instruction format
41
+
42
+ In order to leverage instruction fine-tuning, your prompt should be surrounded by `[INST]` and `[/INST]` tokens. The very first instruction should begin with a begin of sentence id. The next instructions should not. The assistant generation will be ended by the end-of-sentence token id.
43
+
44
+ E.g.
45
+ ```
46
+ text = "<s>[INST] What is your favourite condiment? [/INST]"
47
+ "Well, I'm quite partial to a good squeeze of fresh lemon juice. It adds just the right amount of zesty flavour to whatever I'm cooking up in the kitchen!</s> "
48
+ "[INST] Do you have mayonnaise recipes? [/INST]"
49
+ ```
50
+
51
+ This format is available as a [chat template](https://huggingface.co/docs/transformers/main/chat_templating) via the `apply_chat_template()` method:
52
+
53
+ ```python
54
+ from transformers import AutoModelForCausalLM, AutoTokenizer
55
+
56
+ device = "cuda" # the device to load the model onto
57
+
58
+ model = AutoModelForCausalLM.from_pretrained("mistralai/Mistral-7B-Instruct-v0.2")
59
+ tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-Instruct-v0.2")
60
+
61
+ messages = [
62
+ {"role": "user", "content": "What is your favourite condiment?"},
63
+ {"role": "assistant", "content": "Well, I'm quite partial to a good squeeze of fresh lemon juice. It adds just the right amount of zesty flavour to whatever I'm cooking up in the kitchen!"},
64
+ {"role": "user", "content": "Do you have mayonnaise recipes?"}
65
+ ]
66
+
67
+ encodeds = tokenizer.apply_chat_template(messages, return_tensors="pt")
68
+
69
+ model_inputs = encodeds.to(device)
70
+ model.to(device)
71
+
72
+ generated_ids = model.generate(model_inputs, max_new_tokens=1000, do_sample=True)
73
+ decoded = tokenizer.batch_decode(generated_ids)
74
+ print(decoded[0])
75
+ ```
76
+
77
+ ## Model Architecture
78
+ This instruction model is based on Mistral-7B-v0.1, a transformer model with the following architecture choices:
79
+ - Grouped-Query Attention
80
+ - Sliding-Window Attention
81
+ - Byte-fallback BPE tokenizer
82
+
83
+ ## Troubleshooting
84
+ - If you see the following error:
85
+ ```
86
+ Traceback (most recent call last):
87
+ File "", line 1, in
88
+ File "/transformers/models/auto/auto_factory.py", line 482, in from_pretrained
89
+ config, kwargs = AutoConfig.from_pretrained(
90
+ File "/transformers/models/auto/configuration_auto.py", line 1022, in from_pretrained
91
+ config_class = CONFIG_MAPPING[config_dict["model_type"]]
92
+ File "/transformers/models/auto/configuration_auto.py", line 723, in getitem
93
+ raise KeyError(key)
94
+ KeyError: 'mistral'
95
+ ```
96
+
97
+ Installing transformers from source should solve the issue
98
+ pip install git+https://github.com/huggingface/transformers
99
+
100
+ This should not be required after transformers-v4.33.4.
101
+
102
+ ## Limitations
103
+
104
+ The Mistral 7B Instruct model is a quick demonstration that the base model can be easily fine-tuned to achieve compelling performance.
105
+ It does not have any moderation mechanisms. We're looking forward to engaging with the community on ways to
106
+ make the model finely respect guardrails, allowing for deployment in environments requiring moderated outputs.
107
+
108
+ ## The Mistral AI Team
109
+
110
+ 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.