MaziyarPanahi commited on
Commit
0ac09da
1 Parent(s): dd64b95

Upload folder using huggingface_hub

Browse files
README.md ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.2
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
+ - region:us
31
+ - license:apache-2.0
32
+ model_name: zephyr-7b-beta-Mistral-7B-Instruct-v0.2-GPTQ
33
+ base_model: MaziyarPanahi/zephyr-7b-beta-Mistral-7B-Instruct-v0.2
34
+ inference: false
35
+ model_creator: MaziyarPanahi
36
+ pipeline_tag: text-generation
37
+ quantized_by: MaziyarPanahi
38
+ ---
39
+ # Description
40
+ [MaziyarPanahi/zephyr-7b-beta-Mistral-7B-Instruct-v0.2-GPTQ](https://huggingface.co/MaziyarPanahi/zephyr-7b-beta-Mistral-7B-Instruct-v0.2-GPTQ) is a quantized (GPTQ) version of [MaziyarPanahi/zephyr-7b-beta-Mistral-7B-Instruct-v0.2](https://huggingface.co/MaziyarPanahi/zephyr-7b-beta-Mistral-7B-Instruct-v0.2)
41
+
42
+ ## How to use
43
+ ### Install the necessary packages
44
+
45
+ ```
46
+ pip install --upgrade accelerate auto-gptq transformers
47
+ ```
48
+
49
+ ### Example Python code
50
+
51
+
52
+ ```python
53
+ from transformers import AutoTokenizer, pipeline
54
+ from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
55
+ import torch
56
+
57
+ model_id = "MaziyarPanahi/zephyr-7b-beta-Mistral-7B-Instruct-v0.2-GPTQ"
58
+
59
+ quantize_config = BaseQuantizeConfig(
60
+ bits=4,
61
+ group_size=128,
62
+ desc_act=False
63
+ )
64
+
65
+ model = AutoGPTQForCausalLM.from_quantized(
66
+ model_id,
67
+ use_safetensors=True,
68
+ device="cuda:0",
69
+ quantize_config=quantize_config)
70
+
71
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
72
+
73
+ pipe = pipeline(
74
+ "text-generation",
75
+ model=model,
76
+ tokenizer=tokenizer,
77
+ max_new_tokens=512,
78
+ temperature=0.7,
79
+ top_p=0.95,
80
+ repetition_penalty=1.1
81
+ )
82
+
83
+ outputs = pipe("What is a large language model?")
84
+ print(outputs[0]["generated_text"])
85
+ ```
config.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "MaziyarPanahi/zephyr-7b-beta-Mistral-7B-Instruct-v0.2",
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": 1000000.0,
20
+ "sliding_window": null,
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:85cf435fe51a8377b7d63bf7ef071f00b07e1a1c6e8a4d2a9c687281f5250f1b
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
+ }