Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Model Card for Mistral-7B-Instruct-v0.1-8bit
|
2 |
+
|
3 |
+
The Mistral-7B-Instruct-v0.1-8bit is a 8bit quantize version with torch_dtype=torch.float16, I just load in 8bit and push here [Mistral-7B-Instruct-v0.1](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.1).
|
4 |
+
|
5 |
+
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/).
|
6 |
+
|
7 |
+
```python
|
8 |
+
import torch
|
9 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
10 |
+
|
11 |
+
model_name = "mistralai/Mistral-7B-Instruct-v0.1"
|
12 |
+
|
13 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
14 |
+
model = AutoModelForCausalLM.from_pretrained(
|
15 |
+
model_name,
|
16 |
+
load_in_8bit=True,
|
17 |
+
use_flash_attention_2=True,
|
18 |
+
torch_dtype=torch.float16,
|
19 |
+
)
|
20 |
+
|
21 |
+
model.push_to_hub("LsTam/Mistral-7B-Instruct-v0.1-8bit")
|
22 |
+
```
|
23 |
+
|
24 |
+
To use it:
|
25 |
+
```python
|
26 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
27 |
+
|
28 |
+
tok_name = "mistralai/Mistral-7B-Instruct-v0.2"
|
29 |
+
model_name = "LsTam/Mistral-7B-Instruct-v0.1-8bit"
|
30 |
+
|
31 |
+
tokenizer = AutoTokenizer.from_pretrained(tok_name)
|
32 |
+
model = AutoModelForCausalLM.from_pretrained(
|
33 |
+
model_name,
|
34 |
+
use_flash_attention_2=True,
|
35 |
+
)
|
36 |
+
```
|