MaziyarPanahi commited on
Commit
a4e5694
1 Parent(s): 6e8e3e4

Upload folder using huggingface_hub

Browse files
README.md ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ - reward model
13
+ - RLHF
14
+ - RLAIF
15
+ - conversational
16
+ - en
17
+ - dataset:berkeley-nest/Nectar
18
+ - arxiv:1909.08593
19
+ - license:apache-2.0
20
+ - autotrain_compatible
21
+ - endpoints_compatible
22
+ - has_space
23
+ - text-generation-inference
24
+ - region:us
25
+ model_name: Starling-LM-7B-beta-GPTQ
26
+ base_model: Nexusflow/Starling-LM-7B-beta
27
+ inference: false
28
+ model_creator: Nexusflow
29
+ pipeline_tag: text-generation
30
+ quantized_by: MaziyarPanahi
31
+ ---
32
+ # Description
33
+ [MaziyarPanahi/Starling-LM-7B-beta-GPTQ](https://huggingface.co/MaziyarPanahi/Starling-LM-7B-beta-GPTQ) is a quantized (GPTQ) version of [Nexusflow/Starling-LM-7B-beta](https://huggingface.co/Nexusflow/Starling-LM-7B-beta)
34
+
35
+ ## How to use
36
+ ### Install the necessary packages
37
+
38
+ ```
39
+ pip install --upgrade accelerate auto-gptq transformers
40
+ ```
41
+
42
+ ### Example Python code
43
+
44
+
45
+ ```python
46
+ from transformers import AutoTokenizer, pipeline
47
+ from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
48
+ import torch
49
+
50
+ model_id = "MaziyarPanahi/Starling-LM-7B-beta-GPTQ"
51
+
52
+ quantize_config = BaseQuantizeConfig(
53
+ bits=4,
54
+ group_size=128,
55
+ desc_act=False
56
+ )
57
+
58
+ model = AutoGPTQForCausalLM.from_quantized(
59
+ model_id,
60
+ use_safetensors=True,
61
+ device="cuda:0",
62
+ quantize_config=quantize_config)
63
+
64
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
65
+
66
+ pipe = pipeline(
67
+ "text-generation",
68
+ model=model,
69
+ tokenizer=tokenizer,
70
+ max_new_tokens=512,
71
+ temperature=0.7,
72
+ top_p=0.95,
73
+ repetition_penalty=1.1
74
+ )
75
+
76
+ outputs = pipe("What is a large language model?")
77
+ print(outputs[0]["generated_text"])
78
+ ```
added_tokens.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "<|end_of_turn|>": 32000,
3
+ "<|pad_0|>": 32001
4
+ }
config.json ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "Nexusflow/Starling-LM-7B-beta",
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": 8192,
14
+ "model_type": "mistral",
15
+ "num_attention_heads": 32,
16
+ "num_hidden_layers": 32,
17
+ "num_key_value_heads": 8,
18
+ "pad_token_id": 32000,
19
+ "quantization_config": {
20
+ "bits": 4,
21
+ "checkpoint_format": "gptq",
22
+ "damp_percent": 0.1,
23
+ "desc_act": false,
24
+ "group_size": 128,
25
+ "model_file_base_name": null,
26
+ "model_name_or_path": null,
27
+ "quant_method": "gptq",
28
+ "static_groups": false,
29
+ "sym": true,
30
+ "true_sequential": true
31
+ },
32
+ "rms_norm_eps": 1e-05,
33
+ "rope_theta": 10000.0,
34
+ "sliding_window": 4096,
35
+ "tie_word_embeddings": false,
36
+ "torch_dtype": "float16",
37
+ "transformers_version": "4.39.2",
38
+ "use_cache": true,
39
+ "vocab_size": 32002
40
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6de297bafb3035b5923cd197455c0ccc7f97d61a01ecc281abc3964aa23e6575
3
+ size 4155918248
quantize_config.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ "quant_method": "gptq",
12
+ "checkpoint_format": "gptq"
13
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "<|end_of_turn|>",
4
+ "<|pad_0|>"
5
+ ],
6
+ "bos_token": {
7
+ "content": "<s>",
8
+ "lstrip": false,
9
+ "normalized": false,
10
+ "rstrip": false,
11
+ "single_word": false
12
+ },
13
+ "eos_token": {
14
+ "content": "<|end_of_turn|>",
15
+ "lstrip": false,
16
+ "normalized": false,
17
+ "rstrip": false,
18
+ "single_word": false
19
+ },
20
+ "pad_token": {
21
+ "content": "<|end_of_turn|>",
22
+ "lstrip": false,
23
+ "normalized": false,
24
+ "rstrip": false,
25
+ "single_word": false
26
+ },
27
+ "unk_token": {
28
+ "content": "<unk>",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false
33
+ }
34
+ }
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,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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": "<|end_of_turn|>",
31
+ "lstrip": false,
32
+ "normalized": false,
33
+ "rstrip": false,
34
+ "single_word": false,
35
+ "special": true
36
+ },
37
+ "32001": {
38
+ "content": "<|pad_0|>",
39
+ "lstrip": false,
40
+ "normalized": false,
41
+ "rstrip": false,
42
+ "single_word": false,
43
+ "special": true
44
+ }
45
+ },
46
+ "additional_special_tokens": [
47
+ "<|end_of_turn|>",
48
+ "<|pad_0|>"
49
+ ],
50
+ "bos_token": "<s>",
51
+ "chat_template": "{{ bos_token }}{% for message in messages %}{{ 'GPT4 Correct ' + message['role'].title() + ': ' + message['content'] + '<|end_of_turn|>'}}{% endfor %}{% if add_generation_prompt %}{{ 'GPT4 Correct Assistant:' }}{% endif %}",
52
+ "clean_up_tokenization_spaces": false,
53
+ "eos_token": "<|end_of_turn|>",
54
+ "legacy": true,
55
+ "max_length": 1000,
56
+ "model_max_length": 1000000000000000019884624838656,
57
+ "pad_to_multiple_of": null,
58
+ "pad_token": "<|end_of_turn|>",
59
+ "pad_token_type_id": 0,
60
+ "padding_side": "left",
61
+ "sp_model_kwargs": {},
62
+ "spaces_between_special_tokens": false,
63
+ "stride": 0,
64
+ "tokenizer_class": "LlamaTokenizer",
65
+ "truncation_side": "right",
66
+ "truncation_strategy": "longest_first",
67
+ "unk_token": "<unk>",
68
+ "use_default_system_prompt": true
69
+ }