Views
No views yet
Llama 3 Youko 8B Instruct (rinna/llama-3-youko-8b-instruct)
| Size | Continual Pre-Training | Instruction-Tuning |
|---|---|---|
| 8B | Llama 3 Youko 8B [HF] [GPTQ] | Llama 3 Youko 8B Instruct [HF] [GPTQ] |
| 70B | Llama 3 Youko 70B [HF] [GPTQ] | Llama 3 Youko 70B Instruct [HF] [GPTQ] |
llama-3-youko-8b-sft + 0.5 * (meta-llama/Meta-Llama-3-8B-Instruct - meta-llama/Meta-Llama-3-8B)1import torch
2from transformers import AutoTokenizer, AutoModelForCausalLM
3
4model_id = "rinna/llama-3-youko-8b-instruct"
5
6tokenizer = AutoTokenizer.from_pretrained(model_id)
7model = AutoModelForCausalLM.from_pretrained(
8 model_id,
9 torch_dtype=torch.bfloat16,
10 device_map="auto",
11)
12
13messages = [
14 {"role": "system", "content": "あなたは誠実で優秀なアシスタントです。どうか、簡潔かつ正直に答えてください。"},
15 {"role": "user", "content": "西田幾多郎とはどんな人物ですか?"},
16]
17
18input_ids = tokenizer.apply_chat_template(
19 messages,
20 add_generation_prompt=True,
21 return_tensors="pt"
22).to(model.device)
23
24terminators = [
25 tokenizer.convert_tokens_to_ids("<|end_of_text|>"),
26 tokenizer.convert_tokens_to_ids("<|eot_id|>")
27]
28
29outputs = model.generate(
30 input_ids,
31 max_new_tokens=512,
32 eos_token_id=terminators,
33 do_sample=True,
34 temperature=0.6,
35 top_p=0.9,
36 repetition_penalty=1.1,
37)
38
39response = outputs[0][input_ids.shape[-1]:]
40response = tokenizer.decode(response, skip_special_tokens=True)
41print(response)1@misc{rinna-llama-3-youko-8b-instruct,
2 title = {rinna/llama-3-youko-8b-instruct},
3 author = {Chen, Xinqi and Mitsuda, Koh and Wakatsuki, Toshiaki and Sawada, Kei},
4 url = {https://huggingface.co/rinna/llama-3-youko-8b-instruct}
5}
6
7@inproceedings{sawada2024release,
8 title = {Release of Pre-Trained Models for the {J}apanese Language},
9 author = {Sawada, Kei and Zhao, Tianyu and Shing, Makoto and Mitsui, Kentaro and Kaga, Akio and Hono, Yukiya and Wakatsuki, Toshiaki and Mitsuda, Koh},
10 booktitle = {Proceedings of the 2024 Joint International Conference on Computational Linguistics, Language Resources and Evaluation (LREC-COLING 2024)},
11 month = {5},
12 year = {2024},
13 pages = {13898--13905},
14 url = {https://aclanthology.org/2024.lrec-main.1213},
15 note = {\url{https://arxiv.org/abs/2404.01657}}
16}1@article{llama3modelcard,
2 title = {Llama 3 Model Card},
3 author = {AI@Meta},
4 year = {2024},
5 url = {https://github.com/meta-llama/llama3/blob/main/MODEL_CARD.md}
6}
7
8@article{huang2023chat,
9 title = {Chat Vector: A Simple Approach to Equip LLMs with Instruction Following and Model Alignment in New Languages},
10 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},
11 year = {2023},
12 url = {https://arxiv.org/abs/2310.04799}
13}