MaziyarPanahi
commited on
Commit
•
8264e20
1
Parent(s):
88c0c33
Upload folder using huggingface_hub
Browse files- README.md +82 -0
- added_tokens.json +4 -0
- config.json +30 -0
- model.safetensors +3 -0
- quantize_config.json +11 -0
- special_tokens_map.json +30 -0
- tokenizer.json +0 -0
- tokenizer.model +3 -0
- tokenizer_config.json +61 -0
README.md
ADDED
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
tags:
|
4 |
+
- finetuned
|
5 |
+
- quantized
|
6 |
+
- 4-bit
|
7 |
+
- gptq
|
8 |
+
- transformers
|
9 |
+
- safetensors
|
10 |
+
- mixtral
|
11 |
+
- text-generation
|
12 |
+
- Mixtral
|
13 |
+
- instruct
|
14 |
+
- finetune
|
15 |
+
- chatml
|
16 |
+
- DPO
|
17 |
+
- RLHF
|
18 |
+
- gpt4
|
19 |
+
- synthetic data
|
20 |
+
- distillation
|
21 |
+
- en
|
22 |
+
- base_model:mistralai/Mixtral-8x7B-v0.1
|
23 |
+
- license:apache-2.0
|
24 |
+
- autotrain_compatible
|
25 |
+
- endpoints_compatible
|
26 |
+
- has_space
|
27 |
+
- text-generation-inference
|
28 |
+
- region:us
|
29 |
+
model_name: Nous-Hermes-2-Mixtral-8x7B-DPO-GPTQ
|
30 |
+
base_model: NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO
|
31 |
+
inference: false
|
32 |
+
model_creator: NousResearch
|
33 |
+
pipeline_tag: text-generation
|
34 |
+
quantized_by: MaziyarPanahi
|
35 |
+
---
|
36 |
+
# Description
|
37 |
+
[MaziyarPanahi/Nous-Hermes-2-Mixtral-8x7B-DPO-GPTQ](https://huggingface.co/MaziyarPanahi/Nous-Hermes-2-Mixtral-8x7B-DPO-GPTQ) is a quantized (GPTQ) version of [NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO](https://huggingface.co/NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO)
|
38 |
+
|
39 |
+
## How to use
|
40 |
+
### Install the necessary packages
|
41 |
+
|
42 |
+
```
|
43 |
+
pip install --upgrade accelerate auto-gptq transformers
|
44 |
+
```
|
45 |
+
|
46 |
+
### Example Python code
|
47 |
+
|
48 |
+
|
49 |
+
```python
|
50 |
+
from transformers import AutoTokenizer, pipeline
|
51 |
+
from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
|
52 |
+
import torch
|
53 |
+
|
54 |
+
model_id = "MaziyarPanahi/Nous-Hermes-2-Mixtral-8x7B-DPO-GPTQ"
|
55 |
+
|
56 |
+
quantize_config = BaseQuantizeConfig(
|
57 |
+
bits=4,
|
58 |
+
group_size=128,
|
59 |
+
desc_act=False
|
60 |
+
)
|
61 |
+
|
62 |
+
model = AutoGPTQForCausalLM.from_quantized(
|
63 |
+
model_id,
|
64 |
+
use_safetensors=True,
|
65 |
+
device="cuda:0",
|
66 |
+
quantize_config=quantize_config)
|
67 |
+
|
68 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
69 |
+
|
70 |
+
pipe = pipeline(
|
71 |
+
"text-generation",
|
72 |
+
model=model,
|
73 |
+
tokenizer=tokenizer,
|
74 |
+
max_new_tokens=512,
|
75 |
+
temperature=0.7,
|
76 |
+
top_p=0.95,
|
77 |
+
repetition_penalty=1.1
|
78 |
+
)
|
79 |
+
|
80 |
+
outputs = pipe("What is a large language model?")
|
81 |
+
print(outputs[0]["generated_text"])
|
82 |
+
```
|
added_tokens.json
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"<|im_end|>": 32000,
|
3 |
+
"<|im_start|>": 32001
|
4 |
+
}
|
config.json
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO",
|
3 |
+
"architectures": [
|
4 |
+
"MixtralForCausalLM"
|
5 |
+
],
|
6 |
+
"attention_dropout": 0.0,
|
7 |
+
"bos_token_id": 1,
|
8 |
+
"eos_token_id": 32000,
|
9 |
+
"hidden_act": "silu",
|
10 |
+
"hidden_size": 4096,
|
11 |
+
"initializer_range": 0.02,
|
12 |
+
"intermediate_size": 14336,
|
13 |
+
"max_position_embeddings": 32768,
|
14 |
+
"model_type": "mixtral",
|
15 |
+
"num_attention_heads": 32,
|
16 |
+
"num_experts_per_tok": 2,
|
17 |
+
"num_hidden_layers": 32,
|
18 |
+
"num_key_value_heads": 8,
|
19 |
+
"num_local_experts": 8,
|
20 |
+
"output_router_logits": false,
|
21 |
+
"rms_norm_eps": 1e-05,
|
22 |
+
"rope_theta": 1000000.0,
|
23 |
+
"router_aux_loss_coef": 0.02,
|
24 |
+
"sliding_window": null,
|
25 |
+
"tie_word_embeddings": false,
|
26 |
+
"torch_dtype": "float16",
|
27 |
+
"transformers_version": "4.36.2",
|
28 |
+
"use_cache": false,
|
29 |
+
"vocab_size": 32002
|
30 |
+
}
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8b7ee4884f19e5665f1af917ad2d06657269f96a5d89482de04045a9b52c7641
|
3 |
+
size 24696811840
|
quantize_config.json
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bits": 4,
|
3 |
+
"group_size": 128,
|
4 |
+
"damp_percent": 0.1,
|
5 |
+
"desc_act": false,
|
6 |
+
"static_groups": false,
|
7 |
+
"sym": true,
|
8 |
+
"true_sequential": true,
|
9 |
+
"model_name_or_path": null,
|
10 |
+
"model_file_base_name": null
|
11 |
+
}
|
special_tokens_map.json
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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": "<|im_end|>",
|
11 |
+
"lstrip": false,
|
12 |
+
"normalized": false,
|
13 |
+
"rstrip": false,
|
14 |
+
"single_word": false
|
15 |
+
},
|
16 |
+
"pad_token": {
|
17 |
+
"content": "</s>",
|
18 |
+
"lstrip": false,
|
19 |
+
"normalized": false,
|
20 |
+
"rstrip": false,
|
21 |
+
"single_word": false
|
22 |
+
},
|
23 |
+
"unk_token": {
|
24 |
+
"content": "<unk>",
|
25 |
+
"lstrip": false,
|
26 |
+
"normalized": false,
|
27 |
+
"rstrip": false,
|
28 |
+
"single_word": false
|
29 |
+
}
|
30 |
+
}
|
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,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
"32000": {
|
30 |
+
"content": "<|im_end|>",
|
31 |
+
"lstrip": false,
|
32 |
+
"normalized": false,
|
33 |
+
"rstrip": false,
|
34 |
+
"single_word": false,
|
35 |
+
"special": true
|
36 |
+
},
|
37 |
+
"32001": {
|
38 |
+
"content": "<|im_start|>",
|
39 |
+
"lstrip": false,
|
40 |
+
"normalized": false,
|
41 |
+
"rstrip": false,
|
42 |
+
"single_word": false,
|
43 |
+
"special": false
|
44 |
+
}
|
45 |
+
},
|
46 |
+
"additional_special_tokens": [],
|
47 |
+
"bos_token": "<s>",
|
48 |
+
"chat_template": "{% for message in messages %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}",
|
49 |
+
"clean_up_tokenization_spaces": false,
|
50 |
+
"eos_token": "<|im_end|>",
|
51 |
+
"legacy": true,
|
52 |
+
"model_max_length": 1000000000000000019884624838656,
|
53 |
+
"pad_token": "</s>",
|
54 |
+
"sp_model_kwargs": {},
|
55 |
+
"spaces_between_special_tokens": false,
|
56 |
+
"tokenizer_class": "LlamaTokenizer",
|
57 |
+
"trust_remote_code": false,
|
58 |
+
"unk_token": "<unk>",
|
59 |
+
"use_default_system_prompt": false,
|
60 |
+
"use_fast": true
|
61 |
+
}
|