Text Generation
Transformers
Safetensors
PyTorch
mistral
finetuned
quantized
4-bit precision
gptq
Generated from Trainer
en
dataset:HuggingFaceH4/ultrachat_200k
dataset:HuggingFaceH4/ultrafeedback_binarized
arxiv:2305.18290
arxiv:2310.16944
Eval Results
Inference Endpoints
has_space
text-generation-inference
conversational
MaziyarPanahi
commited on
Commit
•
b1717fa
1
Parent(s):
0f0d56a
Upload folder using huggingface_hub
Browse files- README.md +80 -0
- config.json +27 -0
- model.safetensors +3 -0
- quantize_config.json +11 -0
- special_tokens_map.json +35 -0
- tokenizer.json +0 -0
- tokenizer.model +3 -0
- tokenizer_config.json +48 -0
README.md
ADDED
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
tags:
|
4 |
+
- finetuned
|
5 |
+
- quantized
|
6 |
+
- 4-bit
|
7 |
+
- gptq
|
8 |
+
- transformers
|
9 |
+
- pytorch
|
10 |
+
- safetensors
|
11 |
+
- mistral
|
12 |
+
- text-generation
|
13 |
+
- generated_from_trainer
|
14 |
+
- en
|
15 |
+
- dataset:HuggingFaceH4/ultrachat_200k
|
16 |
+
- dataset:HuggingFaceH4/ultrafeedback_binarized
|
17 |
+
- arxiv:2305.18290
|
18 |
+
- arxiv:2310.16944
|
19 |
+
- base_model:mistralai/Mistral-7B-v0.1
|
20 |
+
- license:mit
|
21 |
+
- model-index
|
22 |
+
- autotrain_compatible
|
23 |
+
- endpoints_compatible
|
24 |
+
- has_space
|
25 |
+
- text-generation-inference
|
26 |
+
- region:us
|
27 |
+
model_name: zephyr-7b-beta-GPTQ
|
28 |
+
base_model: HuggingFaceH4/zephyr-7b-beta
|
29 |
+
inference: false
|
30 |
+
model_creator: HuggingFaceH4
|
31 |
+
pipeline_tag: text-generation
|
32 |
+
quantized_by: MaziyarPanahi
|
33 |
+
---
|
34 |
+
# Description
|
35 |
+
[MaziyarPanahi/zephyr-7b-beta-GPTQ](https://huggingface.co/MaziyarPanahi/zephyr-7b-beta-GPTQ) is a quantized (GPTQ) version of [HuggingFaceH4/zephyr-7b-beta](https://huggingface.co/HuggingFaceH4/zephyr-7b-beta)
|
36 |
+
|
37 |
+
## How to use
|
38 |
+
### Install the necessary packages
|
39 |
+
|
40 |
+
```
|
41 |
+
pip install --upgrade accelerate auto-gptq transformers
|
42 |
+
```
|
43 |
+
|
44 |
+
### Example Python code
|
45 |
+
|
46 |
+
|
47 |
+
```python
|
48 |
+
from transformers import AutoTokenizer, pipeline
|
49 |
+
from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
|
50 |
+
import torch
|
51 |
+
|
52 |
+
model_id = "MaziyarPanahi/zephyr-7b-beta-GPTQ"
|
53 |
+
|
54 |
+
quantize_config = BaseQuantizeConfig(
|
55 |
+
bits=4,
|
56 |
+
group_size=128,
|
57 |
+
desc_act=False
|
58 |
+
)
|
59 |
+
|
60 |
+
model = AutoGPTQForCausalLM.from_quantized(
|
61 |
+
model_id,
|
62 |
+
use_safetensors=True,
|
63 |
+
device="cuda:0",
|
64 |
+
quantize_config=quantize_config)
|
65 |
+
|
66 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
67 |
+
|
68 |
+
pipe = pipeline(
|
69 |
+
"text-generation",
|
70 |
+
model=model,
|
71 |
+
tokenizer=tokenizer,
|
72 |
+
max_new_tokens=512,
|
73 |
+
temperature=0.7,
|
74 |
+
top_p=0.95,
|
75 |
+
repetition_penalty=1.1
|
76 |
+
)
|
77 |
+
|
78 |
+
outputs = pipe("What is a large language model?")
|
79 |
+
print(outputs[0]["generated_text"])
|
80 |
+
```
|
config.json
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "HuggingFaceH4/zephyr-7b-beta",
|
3 |
+
"architectures": [
|
4 |
+
"MistralForCausalLM"
|
5 |
+
],
|
6 |
+
"attention_dropout": 0.0,
|
7 |
+
"bos_token_id": 1,
|
8 |
+
"eos_token_id": 2,
|
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 |
+
"pad_token_id": 2,
|
19 |
+
"rms_norm_eps": 1e-05,
|
20 |
+
"rope_theta": 10000.0,
|
21 |
+
"sliding_window": 4096,
|
22 |
+
"tie_word_embeddings": false,
|
23 |
+
"torch_dtype": "float16",
|
24 |
+
"transformers_version": "4.36.2",
|
25 |
+
"use_cache": true,
|
26 |
+
"vocab_size": 32000
|
27 |
+
}
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:26455200e6a104af5afe82c93d20fabdc9de2ec294008f09c6c133821ad30439
|
3 |
+
size 4158662208
|
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,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"additional_special_tokens": [
|
3 |
+
"<unk>",
|
4 |
+
"<s>",
|
5 |
+
"</s>"
|
6 |
+
],
|
7 |
+
"bos_token": {
|
8 |
+
"content": "<s>",
|
9 |
+
"lstrip": false,
|
10 |
+
"normalized": false,
|
11 |
+
"rstrip": false,
|
12 |
+
"single_word": false
|
13 |
+
},
|
14 |
+
"eos_token": {
|
15 |
+
"content": "</s>",
|
16 |
+
"lstrip": false,
|
17 |
+
"normalized": false,
|
18 |
+
"rstrip": false,
|
19 |
+
"single_word": false
|
20 |
+
},
|
21 |
+
"pad_token": {
|
22 |
+
"content": "</s>",
|
23 |
+
"lstrip": false,
|
24 |
+
"normalized": false,
|
25 |
+
"rstrip": false,
|
26 |
+
"single_word": false
|
27 |
+
},
|
28 |
+
"unk_token": {
|
29 |
+
"content": "<unk>",
|
30 |
+
"lstrip": false,
|
31 |
+
"normalized": false,
|
32 |
+
"rstrip": false,
|
33 |
+
"single_word": false
|
34 |
+
}
|
35 |
+
}
|
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,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
},
|
30 |
+
"additional_special_tokens": [
|
31 |
+
"<unk>",
|
32 |
+
"<s>",
|
33 |
+
"</s>"
|
34 |
+
],
|
35 |
+
"bos_token": "<s>",
|
36 |
+
"chat_template": "{% for message in messages %}\n{% if message['role'] == 'user' %}\n{{ '<|user|>\n' + message['content'] + eos_token }}\n{% elif message['role'] == 'system' %}\n{{ '<|system|>\n' + message['content'] + eos_token }}\n{% elif message['role'] == 'assistant' %}\n{{ '<|assistant|>\n' + message['content'] + eos_token }}\n{% endif %}\n{% if loop.last and add_generation_prompt %}\n{{ '<|assistant|>' }}\n{% endif %}\n{% endfor %}",
|
37 |
+
"clean_up_tokenization_spaces": false,
|
38 |
+
"eos_token": "</s>",
|
39 |
+
"legacy": true,
|
40 |
+
"model_max_length": 1000000000000000019884624838656,
|
41 |
+
"pad_token": "</s>",
|
42 |
+
"sp_model_kwargs": {},
|
43 |
+
"spaces_between_special_tokens": false,
|
44 |
+
"tokenizer_class": "LlamaTokenizer",
|
45 |
+
"truncation_side": "left",
|
46 |
+
"unk_token": "<unk>",
|
47 |
+
"use_default_system_prompt": true
|
48 |
+
}
|