MaziyarPanahi commited on
Commit
d05f988
1 Parent(s): f65716e

Upload folder using huggingface_hub

Browse files
README.md ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ tags:
4
+ - finetuned
5
+ - quantized
6
+ - 4-bit
7
+ - gptq
8
+ - transformers
9
+ - safetensors
10
+ - mistral
11
+ - text-generation
12
+ - Safetensors
13
+ - text-generation-inference
14
+ - merge
15
+ - 7b
16
+ - mistralai/Mistral-7B-Instruct-v0.1
17
+ - HuggingFaceH4/zephyr-7b-beta
18
+ - pytorch
19
+ - generated_from_trainer
20
+ - en
21
+ - dataset:HuggingFaceH4/ultrachat_200k
22
+ - dataset:HuggingFaceH4/ultrafeedback_binarized
23
+ - arxiv:2305.18290
24
+ - arxiv:2310.16944
25
+ - base_model:mistralai/Mistral-7B-v0.1
26
+ - license:mit
27
+ - model-index
28
+ - autotrain_compatible
29
+ - endpoints_compatible
30
+ - has_space
31
+ - region:us
32
+ - license:apache-2.0
33
+ model_name: zephyr-7b-beta-Mistral-7B-Instruct-v0.1-GPTQ
34
+ base_model: MaziyarPanahi/zephyr-7b-beta-Mistral-7B-Instruct-v0.1
35
+ inference: false
36
+ model_creator: MaziyarPanahi
37
+ pipeline_tag: text-generation
38
+ quantized_by: MaziyarPanahi
39
+ ---
40
+ # Description
41
+ [MaziyarPanahi/zephyr-7b-beta-Mistral-7B-Instruct-v0.1-GPTQ](https://huggingface.co/MaziyarPanahi/zephyr-7b-beta-Mistral-7B-Instruct-v0.1-GPTQ) is a quantized (GPTQ) version of [MaziyarPanahi/zephyr-7b-beta-Mistral-7B-Instruct-v0.1](https://huggingface.co/MaziyarPanahi/zephyr-7b-beta-Mistral-7B-Instruct-v0.1)
42
+
43
+ ## How to use
44
+ ### Install the necessary packages
45
+
46
+ ```
47
+ pip install --upgrade accelerate auto-gptq transformers
48
+ ```
49
+
50
+ ### Example Python code
51
+
52
+
53
+ ```python
54
+ from transformers import AutoTokenizer, pipeline
55
+ from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
56
+ import torch
57
+
58
+ model_id = "MaziyarPanahi/zephyr-7b-beta-Mistral-7B-Instruct-v0.1-GPTQ"
59
+
60
+ quantize_config = BaseQuantizeConfig(
61
+ bits=4,
62
+ group_size=128,
63
+ desc_act=False
64
+ )
65
+
66
+ model = AutoGPTQForCausalLM.from_quantized(
67
+ model_id,
68
+ use_safetensors=True,
69
+ device="cuda:0",
70
+ quantize_config=quantize_config)
71
+
72
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
73
+
74
+ pipe = pipeline(
75
+ "text-generation",
76
+ model=model,
77
+ tokenizer=tokenizer,
78
+ max_new_tokens=512,
79
+ temperature=0.7,
80
+ top_p=0.95,
81
+ repetition_penalty=1.1
82
+ )
83
+
84
+ outputs = pipe("What is a large language model?")
85
+ print(outputs[0]["generated_text"])
86
+ ```
config.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "MaziyarPanahi/zephyr-7b-beta-Mistral-7B-Instruct-v0.1",
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
+ "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": 32000
26
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a838bee9f56dddcd8896da755c1da5f4a51d6b679547bbcf6c083530b6cd66c6
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,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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": "</s>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "unk_token": {
17
+ "content": "<unk>",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
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,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ "bos_token": "<s>",
32
+ "chat_template": "{{ bos_token }}{% for message in messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if message['role'] == 'user' %}{{ '[INST] ' + message['content'] + ' [/INST]' }}{% elif message['role'] == 'assistant' %}{{ message['content'] + eos_token + ' ' }}{% else %}{{ raise_exception('Only user and assistant roles are supported!') }}{% endif %}{% endfor %}",
33
+ "clean_up_tokenization_spaces": false,
34
+ "eos_token": "</s>",
35
+ "legacy": true,
36
+ "model_max_length": 1000000000000000019884624838656,
37
+ "pad_token": null,
38
+ "sp_model_kwargs": {},
39
+ "spaces_between_special_tokens": false,
40
+ "tokenizer_class": "LlamaTokenizer",
41
+ "unk_token": "<unk>",
42
+ "use_default_system_prompt": false
43
+ }