RichardErkhov commited on
Commit
fb35d2a
·
verified ·
1 Parent(s): 85fbfe0

uploaded readme

Browse files
Files changed (1) hide show
  1. README.md +204 -0
README.md ADDED
@@ -0,0 +1,204 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Quantization made by Richard Erkhov.
2
+
3
+ [Github](https://github.com/RichardErkhov)
4
+
5
+ [Discord](https://discord.gg/pvy7H8DZMG)
6
+
7
+ [Request more models](https://github.com/RichardErkhov/quant_request)
8
+
9
+
10
+ llama-3-youko-70b-instruct - GGUF
11
+ - Model creator: https://huggingface.co/rinna/
12
+ - Original model: https://huggingface.co/rinna/llama-3-youko-70b-instruct/
13
+
14
+
15
+ | Name | Quant method | Size |
16
+ | ---- | ---- | ---- |
17
+ | [llama-3-youko-70b-instruct.Q2_K.gguf](https://huggingface.co/RichardErkhov/rinna_-_llama-3-youko-70b-instruct-gguf/blob/main/llama-3-youko-70b-instruct.Q2_K.gguf) | Q2_K | 24.56GB |
18
+ | [llama-3-youko-70b-instruct.IQ3_XS.gguf](https://huggingface.co/RichardErkhov/rinna_-_llama-3-youko-70b-instruct-gguf/blob/main/llama-3-youko-70b-instruct.IQ3_XS.gguf) | IQ3_XS | 27.29GB |
19
+ | [llama-3-youko-70b-instruct.IQ3_S.gguf](https://huggingface.co/RichardErkhov/rinna_-_llama-3-youko-70b-instruct-gguf/blob/main/llama-3-youko-70b-instruct.IQ3_S.gguf) | IQ3_S | 28.79GB |
20
+ | [llama-3-youko-70b-instruct.Q3_K_S.gguf](https://huggingface.co/RichardErkhov/rinna_-_llama-3-youko-70b-instruct-gguf/blob/main/llama-3-youko-70b-instruct.Q3_K_S.gguf) | Q3_K_S | 28.79GB |
21
+ | [llama-3-youko-70b-instruct.IQ3_M.gguf](https://huggingface.co/RichardErkhov/rinna_-_llama-3-youko-70b-instruct-gguf/blob/main/llama-3-youko-70b-instruct.IQ3_M.gguf) | IQ3_M | 29.74GB |
22
+ | [llama-3-youko-70b-instruct.Q3_K.gguf](https://huggingface.co/RichardErkhov/rinna_-_llama-3-youko-70b-instruct-gguf/blob/main/llama-3-youko-70b-instruct.Q3_K.gguf) | Q3_K | 31.91GB |
23
+ | [llama-3-youko-70b-instruct.Q3_K_M.gguf](https://huggingface.co/RichardErkhov/rinna_-_llama-3-youko-70b-instruct-gguf/blob/main/llama-3-youko-70b-instruct.Q3_K_M.gguf) | Q3_K_M | 31.91GB |
24
+ | [llama-3-youko-70b-instruct.Q3_K_L.gguf](https://huggingface.co/RichardErkhov/rinna_-_llama-3-youko-70b-instruct-gguf/blob/main/llama-3-youko-70b-instruct.Q3_K_L.gguf) | Q3_K_L | 34.59GB |
25
+ | [llama-3-youko-70b-instruct.IQ4_XS.gguf](https://huggingface.co/RichardErkhov/rinna_-_llama-3-youko-70b-instruct-gguf/blob/main/llama-3-youko-70b-instruct.IQ4_XS.gguf) | IQ4_XS | 35.64GB |
26
+ | [llama-3-youko-70b-instruct.Q4_0.gguf](https://huggingface.co/RichardErkhov/rinna_-_llama-3-youko-70b-instruct-gguf/blob/main/llama-3-youko-70b-instruct.Q4_0.gguf) | Q4_0 | 37.22GB |
27
+ | [llama-3-youko-70b-instruct.IQ4_NL.gguf](https://huggingface.co/RichardErkhov/rinna_-_llama-3-youko-70b-instruct-gguf/tree/main/) | IQ4_NL | 37.58GB |
28
+ | [llama-3-youko-70b-instruct.Q4_K_S.gguf](https://huggingface.co/RichardErkhov/rinna_-_llama-3-youko-70b-instruct-gguf/tree/main/) | Q4_K_S | 37.58GB |
29
+ | [llama-3-youko-70b-instruct.Q4_K.gguf](https://huggingface.co/RichardErkhov/rinna_-_llama-3-youko-70b-instruct-gguf/tree/main/) | Q4_K | 39.6GB |
30
+ | [llama-3-youko-70b-instruct.Q4_K_M.gguf](https://huggingface.co/RichardErkhov/rinna_-_llama-3-youko-70b-instruct-gguf/tree/main/) | Q4_K_M | 39.6GB |
31
+ | [llama-3-youko-70b-instruct.Q4_1.gguf](https://huggingface.co/RichardErkhov/rinna_-_llama-3-youko-70b-instruct-gguf/tree/main/) | Q4_1 | 41.27GB |
32
+ | [llama-3-youko-70b-instruct.Q5_0.gguf](https://huggingface.co/RichardErkhov/rinna_-_llama-3-youko-70b-instruct-gguf/tree/main/) | Q5_0 | 45.32GB |
33
+ | [llama-3-youko-70b-instruct.Q5_K_S.gguf](https://huggingface.co/RichardErkhov/rinna_-_llama-3-youko-70b-instruct-gguf/tree/main/) | Q5_K_S | 45.32GB |
34
+ | [llama-3-youko-70b-instruct.Q5_K.gguf](https://huggingface.co/RichardErkhov/rinna_-_llama-3-youko-70b-instruct-gguf/tree/main/) | Q5_K | 46.52GB |
35
+ | [llama-3-youko-70b-instruct.Q5_K_M.gguf](https://huggingface.co/RichardErkhov/rinna_-_llama-3-youko-70b-instruct-gguf/tree/main/) | Q5_K_M | 46.52GB |
36
+ | [llama-3-youko-70b-instruct.Q5_1.gguf](https://huggingface.co/RichardErkhov/rinna_-_llama-3-youko-70b-instruct-gguf/tree/main/) | Q5_1 | 49.36GB |
37
+ | [llama-3-youko-70b-instruct.Q6_K.gguf](https://huggingface.co/RichardErkhov/rinna_-_llama-3-youko-70b-instruct-gguf/tree/main/) | Q6_K | 53.91GB |
38
+ | [llama-3-youko-70b-instruct.Q8_0.gguf](https://huggingface.co/RichardErkhov/rinna_-_llama-3-youko-70b-instruct-gguf/tree/main/) | Q8_0 | 69.83GB |
39
+
40
+
41
+
42
+
43
+ Original model description:
44
+ ---
45
+ thumbnail: https://github.com/rinnakk/japanese-pretrained-models/blob/master/rinna.png
46
+ license: llama3
47
+ language:
48
+ - ja
49
+ - en
50
+ tags:
51
+ - llama
52
+ - llama-3
53
+ inference: false
54
+ base_model:
55
+ - rinna/llama-3-youko-70b
56
+ - meta-llama/Meta-Llama-3-70B
57
+ - meta-llama/Meta-Llama-3-70B-Instruct
58
+ base_model_relation: merge
59
+ ---
60
+
61
+ # `Llama 3 Youko 70B Instruct (rinna/llama-3-youko-70b-instruct)`
62
+
63
+ ![rinna-icon](./rinna.png)
64
+
65
+ # Overview
66
+
67
+ The model is the instruction-tuned version of [rinna/llama-3-youko-70b](https://huggingface.co/rinna/llama-3-youko-70b), using supervised fine-tuning (SFT) and [Chat Vector](https://arxiv.org/abs/2310.04799). It adpots the Llama-3 chat format.
68
+
69
+
70
+ | Size | Continual Pre-Training | Instruction-Tuning |
71
+ | :- | :- | :- |
72
+ | 8B | Llama 3 Youko 8B [[HF]](https://huggingface.co/rinna/llama-3-youko-8b) [[GPTQ]](https://huggingface.co/rinna/llama-3-youko-8b-gptq) | Llama 3 Youko 8B Instruct [[HF]](https://huggingface.co/rinna/llama-3-youko-8b-instruct) [[GPTQ]](https://huggingface.co/rinna/llama-3-youko-8b-instruct-gptq) |
73
+ | 70B | Llama 3 Youko 70B [[HF]](https://huggingface.co/rinna/llama-3-youko-70b) [[GPTQ]](https://huggingface.co/rinna/llama-3-youko-70b-gptq) | Llama 3 Youko 70B Instruct [[HF]](https://huggingface.co/rinna/llama-3-youko-70b-instruct) [[GPTQ]](https://huggingface.co/rinna/llama-3-youko-70b-instruct-gptq) |
74
+
75
+ * **Model architecture**
76
+
77
+ A 80-layer, 8192-hidden-size transformer-based language model. Refer to the [Llama 3 Model Card](https://github.com/meta-llama/llama3/blob/main/MODEL_CARD.md) for architecture details.
78
+
79
+ * **Training: Built with Meta Llama 3**
80
+
81
+ **Supervised fine-tuning.** The supervised fine-tuning data is the following dataset.
82
+
83
+ - rinna Dataset
84
+
85
+ **Model merging.** The fine-tuned model (llama-3-youko-70b-sft) has been enhanced through the following chat vector addition. The chat vector was obtained by subtracting the parameter vectors of [meta-llama/Meta-Llama-3-70B](https://huggingface.co/meta-llama/Meta-Llama-3-70B) from those of [meta-llama/Meta-Llama-3-70B-Instruct](https://huggingface.co/meta-llama/Meta-Llama-3-70B-Instruct).
86
+
87
+ ~~~~text
88
+ llama-3-youko-70b-sft + 0.5 * (meta-llama/Meta-Llama-3-70B-Instruct - meta-llama/Meta-Llama-3-70B)
89
+ ~~~~
90
+
91
+ Here, the embedding layer was skipped while subtracting and adding the parameter vectors.
92
+
93
+ * **Contributors**
94
+
95
+ - [Koh Mitsuda](https://huggingface.co/mitsu-koh)
96
+ - [Xinqi Chen](https://huggingface.co/Keely0419)
97
+ - [Toshiaki Wakatsuki](https://huggingface.co/t-w)
98
+ - [Kei Sawada](https://huggingface.co/keisawada)
99
+
100
+ ---
101
+
102
+ # Benchmarking
103
+
104
+ Please refer to [rinna's LM benchmark page](https://rinnakk.github.io/research/benchmarks/lm/index.html).
105
+
106
+ ---
107
+
108
+ # How to use the model
109
+
110
+ We found this instruction-tuned model tends to generate repeated text more often than its base counterpart, and thus we set repetition_penalty=1.1 for better generation performance. The same repetition penalty was applied to the instruction-tuned model in the aforementioned evaluation experiments.
111
+
112
+ ~~~~python
113
+ import torch
114
+ from transformers import AutoTokenizer, AutoModelForCausalLM
115
+
116
+ model_id = "rinna/llama-3-youko-70b-instruct"
117
+
118
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
119
+ model = AutoModelForCausalLM.from_pretrained(
120
+ model_id,
121
+ torch_dtype=torch.bfloat16,
122
+ device_map="auto",
123
+ )
124
+
125
+ messages = [
126
+ {"role": "system", "content": "あなたは誠実で優秀なアシスタントです。どうか、簡潔かつ正直に答えてください。"},
127
+ {"role": "user", "content": "西田幾多郎とはどんな人物ですか?"},
128
+ ]
129
+
130
+ input_ids = tokenizer.apply_chat_template(
131
+ messages,
132
+ add_generation_prompt=True,
133
+ return_tensors="pt"
134
+ ).to(model.device)
135
+
136
+ terminators = [
137
+ tokenizer.convert_tokens_to_ids("<|end_of_text|>"),
138
+ tokenizer.convert_tokens_to_ids("<|eot_id|>")
139
+ ]
140
+
141
+ outputs = model.generate(
142
+ input_ids,
143
+ max_new_tokens=512,
144
+ eos_token_id=terminators,
145
+ do_sample=True,
146
+ temperature=0.6,
147
+ top_p=0.9,
148
+ repetition_penalty=1.1,
149
+ )
150
+
151
+ response = outputs[0][input_ids.shape[-1]:]
152
+ response = tokenizer.decode(response, skip_special_tokens=True)
153
+ print(response)
154
+ ~~~~
155
+
156
+ ---
157
+
158
+ # Tokenization
159
+ The model uses the original [meta-llama/Meta-Llama-3-70B-Instruct](https://huggingface.co/meta-llama/Meta-Llama-3-70B-Instruct) tokenizer.
160
+
161
+ ---
162
+
163
+ # How to cite
164
+ ```bibtex
165
+ @misc{rinna-llama-3-youko-70b-instruct,
166
+ title = {rinna/llama-3-youko-70b-instruct},
167
+ author = {Mitsuda, Koh and Chen, Xinqi and Wakatsuki, Toshiaki and Sawada, Kei},
168
+ url = {https://huggingface.co/rinna/llama-3-youko-70b-instruct}
169
+ }
170
+
171
+ @inproceedings{sawada2024release,
172
+ title = {Release of Pre-Trained Models for the {J}apanese Language},
173
+ author = {Sawada, Kei and Zhao, Tianyu and Shing, Makoto and Mitsui, Kentaro and Kaga, Akio and Hono, Yukiya and Wakatsuki, Toshiaki and Mitsuda, Koh},
174
+ booktitle = {Proceedings of the 2024 Joint International Conference on Computational Linguistics, Language Resources and Evaluation (LREC-COLING 2024)},
175
+ month = {5},
176
+ year = {2024},
177
+ pages = {13898--13905},
178
+ url = {https://aclanthology.org/2024.lrec-main.1213},
179
+ note = {\url{https://arxiv.org/abs/2404.01657}}
180
+ }
181
+ ```
182
+ ---
183
+
184
+ # References
185
+ ```bibtex
186
+ @article{llama3modelcard,
187
+ title = {Llama 3 Model Card},
188
+ author = {AI@Meta},
189
+ year = {2024},
190
+ url = {https://github.com/meta-llama/llama3/blob/main/MODEL_CARD.md}
191
+ }
192
+
193
+ @article{huang2023chat,
194
+ title = {Chat Vector: A Simple Approach to Equip LLMs with Instruction Following and Model Alignment in New Languages},
195
+ author = {Huang, Shih-Cheng and Li, Pin-Zu and Hsu, Yu-Chi and Chen, Kuang-Ming and Lin, Yu Tung and Hsiao, Shih-Kai and Tzong-Han Tsai, Richard and Lee, Hung-yi},
196
+ year = {2023},
197
+ url = {https://arxiv.org/abs/2310.04799}
198
+ }
199
+ ```
200
+ ---
201
+
202
+ # License
203
+ [Meta Llama 3 Community License](https://llama.meta.com/llama3/license/)
204
+