MaziyarPanahi
commited on
Commit
•
d1d5d35
1
Parent(s):
4fc8a77
Upload folder using huggingface_hub
Browse files- README.md +74 -0
- added_tokens.json +4 -0
- config.json +26 -0
- model.safetensors +3 -0
- quantize_config.json +11 -0
- special_tokens_map.json +23 -0
- tokenizer.json +0 -0
- tokenizer.model +3 -0
- tokenizer_config.json +61 -0
README.md
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
tags:
|
4 |
+
- finetuned
|
5 |
+
- quantized
|
6 |
+
- 4-bit
|
7 |
+
- gptq
|
8 |
+
- transformers
|
9 |
+
- pytorch
|
10 |
+
- mistral
|
11 |
+
- text-generation
|
12 |
+
- en
|
13 |
+
- dataset:ehartford/dolphin
|
14 |
+
- dataset:jondurbin/airoboros-2.2.1
|
15 |
+
- license:apache-2.0
|
16 |
+
- autotrain_compatible
|
17 |
+
- endpoints_compatible
|
18 |
+
- has_space
|
19 |
+
- text-generation-inference
|
20 |
+
- region:us
|
21 |
+
model_name: dolphin-2.1-mistral-7b-GPTQ
|
22 |
+
base_model: cognitivecomputations/dolphin-2.1-mistral-7b
|
23 |
+
inference: false
|
24 |
+
model_creator: cognitivecomputations
|
25 |
+
pipeline_tag: text-generation
|
26 |
+
quantized_by: MaziyarPanahi
|
27 |
+
---
|
28 |
+
# Description
|
29 |
+
[MaziyarPanahi/dolphin-2.1-mistral-7b-GPTQ](https://huggingface.co/MaziyarPanahi/dolphin-2.1-mistral-7b-GPTQ) is a quantized (GPTQ) version of [cognitivecomputations/dolphin-2.1-mistral-7b](https://huggingface.co/cognitivecomputations/dolphin-2.1-mistral-7b)
|
30 |
+
|
31 |
+
## How to use
|
32 |
+
### Install the necessary packages
|
33 |
+
|
34 |
+
```
|
35 |
+
pip install --upgrade accelerate auto-gptq transformers
|
36 |
+
```
|
37 |
+
|
38 |
+
### Example Python code
|
39 |
+
|
40 |
+
|
41 |
+
```python
|
42 |
+
from transformers import AutoTokenizer, pipeline
|
43 |
+
from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
|
44 |
+
import torch
|
45 |
+
|
46 |
+
model_id = "MaziyarPanahi/dolphin-2.1-mistral-7b-GPTQ"
|
47 |
+
|
48 |
+
quantize_config = BaseQuantizeConfig(
|
49 |
+
bits=4,
|
50 |
+
group_size=128,
|
51 |
+
desc_act=False
|
52 |
+
)
|
53 |
+
|
54 |
+
model = AutoGPTQForCausalLM.from_quantized(
|
55 |
+
model_id,
|
56 |
+
use_safetensors=True,
|
57 |
+
device="cuda:0",
|
58 |
+
quantize_config=quantize_config)
|
59 |
+
|
60 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
61 |
+
|
62 |
+
pipe = pipeline(
|
63 |
+
"text-generation",
|
64 |
+
model=model,
|
65 |
+
tokenizer=tokenizer,
|
66 |
+
max_new_tokens=512,
|
67 |
+
temperature=0.7,
|
68 |
+
top_p=0.95,
|
69 |
+
repetition_penalty=1.1
|
70 |
+
)
|
71 |
+
|
72 |
+
outputs = pipe("What is a large language model?")
|
73 |
+
print(outputs[0]["generated_text"])
|
74 |
+
```
|
added_tokens.json
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"<|im_end|>": 32000,
|
3 |
+
"<|im_start|>": 32001
|
4 |
+
}
|
config.json
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "cognitivecomputations/dolphin-2.1-mistral-7b",
|
3 |
+
"architectures": [
|
4 |
+
"MistralForCausalLM"
|
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": "mistral",
|
15 |
+
"num_attention_heads": 32,
|
16 |
+
"num_hidden_layers": 32,
|
17 |
+
"num_key_value_heads": 8,
|
18 |
+
"rms_norm_eps": 1e-05,
|
19 |
+
"rope_theta": 10000.0,
|
20 |
+
"sliding_window": 4096,
|
21 |
+
"tie_word_embeddings": false,
|
22 |
+
"torch_dtype": "float16",
|
23 |
+
"transformers_version": "4.36.2",
|
24 |
+
"use_cache": true,
|
25 |
+
"vocab_size": 32002
|
26 |
+
}
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a51561b8117c213e1de21c7a6b0fefe6cd55685b35a815b266c1620c71c5a36e
|
3 |
+
size 4158694976
|
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,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token": {
|
3 |
+
"content": "<s>",
|
4 |
+
"lstrip": true,
|
5 |
+
"normalized": false,
|
6 |
+
"rstrip": true,
|
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 |
+
"unk_token": {
|
17 |
+
"content": "<unk>",
|
18 |
+
"lstrip": true,
|
19 |
+
"normalized": false,
|
20 |
+
"rstrip": true,
|
21 |
+
"single_word": false
|
22 |
+
}
|
23 |
+
}
|
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": true,
|
8 |
+
"normalized": false,
|
9 |
+
"rstrip": true,
|
10 |
+
"single_word": false,
|
11 |
+
"special": true
|
12 |
+
},
|
13 |
+
"1": {
|
14 |
+
"content": "<s>",
|
15 |
+
"lstrip": true,
|
16 |
+
"normalized": false,
|
17 |
+
"rstrip": true,
|
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": true,
|
40 |
+
"normalized": false,
|
41 |
+
"rstrip": true,
|
42 |
+
"single_word": false,
|
43 |
+
"special": true
|
44 |
+
}
|
45 |
+
},
|
46 |
+
"additional_special_tokens": [],
|
47 |
+
"bos_token": "<s>",
|
48 |
+
"chat_template": "{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{% 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": null,
|
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": true,
|
60 |
+
"use_fast": true
|
61 |
+
}
|