Text Generation
Transformers
Japanese
English
llama
text-generation-inference
tianyuz commited on
Commit
7952022
1 Parent(s): 5d23675
README.md ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ thumbnail: https://github.com/rinnakk/japanese-pretrained-models/blob/master/rinna.png
3
+ license: llama2
4
+ datasets:
5
+ - mc4
6
+ - cc100
7
+ - oscar
8
+ - wikipedia
9
+ - EleutherAI/pile
10
+ language:
11
+ - ja
12
+ - en
13
+ inference: false
14
+ ---
15
+
16
+ # `rinna/youri-7b-gptq`
17
+
18
+ ![rinna-icon](./rinna.png)
19
+
20
+ # Overview
21
+ `rinna/youri-7b-gptq` is the quantized model for [`rinna/youri-7b`](https://huggingface.co/rinna/youri-7b) using AutoGPTQ. The quantized version is 4x smaller than the original model and thus requires less memory and provides faster inference.
22
+
23
+ * **Library**
24
+
25
+ Refer to the [original model](https://huggingface.co/rinna/youri-7b) for library details.
26
+
27
+ * **Model architecture**
28
+
29
+ Refer to the [original model](https://huggingface.co/rinna/youri-7b) for architecture details.
30
+
31
+ * **Continual pre-training**
32
+
33
+ Refer to the [original model](https://huggingface.co/rinna/youri-7b) for pre-training details.
34
+
35
+ * **Authors**
36
+
37
+ - [Toshiaki Wakatsuki](https://huggingface.co/t-w)
38
+ - [Tianyu Zhao](https://huggingface.co/tianyuz)
39
+ - [Kei Sawada](https://huggingface.co/keisawada)
40
+
41
+ ---
42
+
43
+ # Benchmarking
44
+
45
+ Our evaluation experiments show that the quantization yields slight performance degradation on downstream tasks.
46
+
47
+ Results will be updated soon.
48
+
49
+ ---
50
+
51
+ # How to use the model
52
+
53
+ ~~~~python
54
+ import torch
55
+ from transformers import AutoTokenizer
56
+ from auto_gptq import AutoGPTQForCausalLM
57
+
58
+ tokenizer = AutoTokenizer.from_pretrained("rinna/youri-7b-gptq")
59
+ model = AutoGPTQForCausalLM.from_quantized("rinna/youri-7b-gptq", use_safetensors=True)
60
+
61
+ text = "西田幾多郎は、"
62
+ token_ids = tokenizer.encode(text, add_special_tokens=False, return_tensors="pt")
63
+
64
+ with torch.no_grad():
65
+ output_ids = model.generate(
66
+ input_ids=token_ids.to(model.device),
67
+ max_new_tokens=200,
68
+ min_new_tokens=200,
69
+ do_sample=True,
70
+ temperature=1.0,
71
+ top_p=0.95,
72
+ pad_token_id=tokenizer.pad_token_id,
73
+ bos_token_id=tokenizer.bos_token_id,
74
+ eos_token_id=tokenizer.eos_token_id
75
+ )
76
+
77
+ output = tokenizer.decode(output_ids.tolist()[0])
78
+ print(output)
79
+ ~~~~
80
+
81
+ ---
82
+
83
+ # Tokenization
84
+ The model uses the original llama-2 tokenizer.
85
+
86
+ ---
87
+
88
+ # How to cite
89
+ ~~~
90
+ @misc{RinnaYouri7bGPTQ,
91
+ url={https://huggingface.co/rinna/youri-7b-gptq},
92
+ title={rinna/youri-7b-gptq},
93
+ author={Wakatsuki, Toshiaki and Zhao, Tianyu and Sawada, Kei}
94
+ }
95
+ ~~~
96
+ ---
97
+
98
+ # License
99
+ [The llama2 license](https://ai.meta.com/llama/license/)
config.json ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "LlamaForCausalLM"
4
+ ],
5
+ "attention_bias": false,
6
+ "bos_token_id": 1,
7
+ "eos_token_id": 2,
8
+ "hidden_act": "silu",
9
+ "hidden_size": 4096,
10
+ "initializer_range": 0.02,
11
+ "intermediate_size": 11008,
12
+ "max_position_embeddings": 4096,
13
+ "model_type": "llama",
14
+ "num_attention_heads": 32,
15
+ "num_hidden_layers": 32,
16
+ "num_key_value_heads": 32,
17
+ "pad_token_id": 0,
18
+ "pretraining_tp": 1,
19
+ "rms_norm_eps": 1e-05,
20
+ "rope_scaling": null,
21
+ "rope_theta": 10000.0,
22
+ "tie_word_embeddings": false,
23
+ "torch_dtype": "float16",
24
+ "transformers_version": "4.34.1",
25
+ "use_cache": true,
26
+ "vocab_size": 32000
27
+ }
gptq_model-4bit-128g.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ac39727e2223dcc453ff57aec70f0111c5024f8a8051516a3e651244c58a7250
3
+ size 3896714728
quantize_config.json ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bits": 4,
3
+ "group_size": 128,
4
+ "damp_percent": 0.01,
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
+ }
rinna.png ADDED
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:9e556afd44213b6bd1be2b850ebbbd98f5481437a8021afaf58ee7fb1818d347
3
+ size 499723
tokenizer_config.json ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "<unk>",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "1": {
12
+ "content": "<s>",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "2": {
20
+ "content": "</s>",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ }
27
+ },
28
+ "bos_token": "<s>",
29
+ "clean_up_tokenization_spaces": false,
30
+ "eos_token": "</s>",
31
+ "legacy": false,
32
+ "model_max_length": 1000000000000000019884624838656,
33
+ "pad_token": null,
34
+ "padding_side": "right",
35
+ "sp_model_kwargs": {},
36
+ "tokenizer_class": "LlamaTokenizer",
37
+ "unk_token": "<unk>",
38
+ "use_default_system_prompt": true
39
+ }