🚀 Llama 3 Youko 8B (rinna/llama-3-youko-8b)
Llama 3 Youko 8B
是基于 meta-llama/Meta-Llama-3-8B
在日语和英语混合数据集上进行持续预训练的模型。持续预训练显著提升了模型在日语任务上的性能。

🚀 快速开始
你可以按照以下代码示例来使用本模型:
import transformers
import torch
model_id = "rinna/llama-3-youko-8b"
pipeline = transformers.pipeline(
"text-generation",
model=model_id,
model_kwargs={"torch_dtype": torch.bfloat16},
device_map="auto"
)
output = pipeline(
"西田幾多郎は、",
max_new_tokens=256,
do_sample=True
)
print(output[0]["generated_text"])
✨ 主要特性
- 多语言训练:在日语和英语混合的约 220 亿个标记上进行持续预训练,提升了模型在日语任务上的性能。
- 模型架构:基于 32 层、隐藏层大小为 4096 的 Transformer 架构。
📦 安装指南
文档未提及安装步骤,你可以参考 Hugging Face 上的相关模型使用说明进行安装。
💻 使用示例
基础用法
import transformers
import torch
model_id = "rinna/llama-3-youko-8b"
pipeline = transformers.pipeline(
"text-generation",
model=model_id,
model_kwargs={"torch_dtype": torch.bfloat16},
device_map="auto"
)
output = pipeline(
"西田幾多郎は、",
max_new_tokens=256,
do_sample=True
)
print(output[0]["generated_text"])
📚 详细文档
模型概述
我们对 meta-llama/Meta-Llama-3-8B 在日语和英语混合数据集的约 22B 个标记上进行持续预训练,显著提升了模型在日语任务上的性能。
模型名称 youko
来源于日语单词 妖狐/ようこ/Youko
,它是一种日本神话生物(妖怪/ようかい/Youkai
)。
模型训练相关信息
贡献者
发布日期
2024 年 5 月 1 日
基准测试
请参考 rinna's LM benchmark page (Sheet 20240507)。
分词
模型使用原始的 meta-llama/Meta-Llama-3-8B 分词器。
引用方式
@misc{rinna-llama-3-youko-8b,
title = {rinna/llama-3-youko-8b},
author = {Mitsuda, Koh and Chen, Xinqi and Wakatsuki, Toshiaki and Sawada, Kei},
url = {https://huggingface.co/rinna/llama-3-youko-8b}
}
@inproceedings{sawada2024release,
title = {Release of Pre-Trained Models for the {J}apanese Language},
author = {Sawada, Kei and Zhao, Tianyu and Shing, Makoto and Mitsui, Kentaro and Kaga, Akio and Hono, Yukiya and Wakatsuki, Toshiaki and Mitsuda, Koh},
booktitle = {Proceedings of the 2024 Joint International Conference on Computational Linguistics, Language Resources and Evaluation (LREC-COLING 2024)},
month = {5},
year = {2024},
pages = {13898--13905},
url = {https://aclanthology.org/2024.lrec-main.1213},
note = {\url{https://arxiv.org/abs/2404.01657}}
}
参考资料
@article{llama3modelcard,
title = {Llama 3 Model Card},
author = {AI@Meta},
year = {2024},
url = {https://github.com/meta-llama/llama3/blob/main/MODEL_CARD.md}
}
@software{gpt-neox-library,
title = {{GPT}-{N}eo{X}: Large Scale Autoregressive Language Modeling in {P}y{T}orch},
author = {Andonian, Alex and Anthony, Quentin and Biderman, Stella and Black, Sid and Gali, Preetham and Gao, Leo and Hallahan, Eric and Levy-Kramer, Josh and Leahy, Connor and Nestler, Lucas and Parker, Kip and Pieler, Michael and Purohit, Shivanshu and Songz, Tri and Phil, Wang and Weinbach, Samuel},
doi = {10.5281/zenodo.5879544},
month = {8},
year = {2021},
version = {0.0.1},
url = {https://www.github.com/eleutherai/gpt-neox}
}
🔧 技术细节
模型是一个 32 层、隐藏层大小为 4096 的基于 Transformer 的语言模型,使用基于 EleutherAI/gpt-neox 的代码进行训练。训练时使用 meta-llama/Meta-Llama-3-8B 模型初始化,并在多种日语和英语语料库的约 220 亿个标记上进行持续训练。
📄 许可证
Meta Llama 3 Community License