🚀 Llama-VARCO-8B-Instruct
Llama-VARCO-8B-Instruct是一个基于Llama构建的生成式模型,通过额外的训练,它在韩语处理方面表现出色。该模型使用韩语和英语数据集进行持续预训练,在增强韩语理解和生成能力的同时,也保持了其在英语方面的熟练程度。它还在韩语上进行了监督微调(SFT)和直接偏好优化(DPO),以符合人类偏好。
🚀 快速开始
我们建议使用transformers v4.43.0或更高版本,这也是Llama-3.1所建议的版本。
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
model = AutoModelForCausalLM.from_pretrained(
"NCSOFT/Llama-VARCO-8B-Instruct",
torch_dtype=torch.bfloat16,
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained("NCSOFT/Llama-VARCO-8B-Instruct")
messages = [
{"role": "system", "content": "You are a helpful assistant Varco. Respond accurately and diligently according to the user's instructions."},
{"role": "user", "content": "안녕하세요."}
]
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt").to(model.device)
eos_token_id = [
tokenizer.eos_token_id,
tokenizer.convert_tokens_to_ids("<|eot_id|>")
]
outputs = model.generate(
inputs,
eos_token_id=eos_token_id,
max_length=8192
)
print(tokenizer.decode(outputs[0]))
✨ 主要特性
- 多语言支持:支持韩语和英语两种语言,在两种语言上都有出色的表现。
- 持续预训练:使用韩语和英语数据集进行持续预训练,增强了模型在韩语上的理解和生成能力。
- 符合人类偏好:通过监督微调(SFT)和直接偏好优化(DPO),使模型输出更符合人类偏好。
📦 安装指南
文档中未提及具体的安装步骤,可参考上述快速开始部分的代码示例,确保使用transformers v4.43.0或更高版本。
💻 使用示例
基础用法
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
model = AutoModelForCausalLM.from_pretrained(
"NCSOFT/Llama-VARCO-8B-Instruct",
torch_dtype=torch.bfloat16,
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained("NCSOFT/Llama-VARCO-8B-Instruct")
messages = [
{"role": "system", "content": "You are a helpful assistant Varco. Respond accurately and diligently according to the user's instructions."},
{"role": "user", "content": "안녕하세요."}
]
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt").to(model.device)
eos_token_id = [
tokenizer.eos_token_id,
tokenizer.convert_tokens_to_ids("<|eot_id|>")
]
outputs = model.generate(
inputs,
eos_token_id=eos_token_id,
max_length=8192
)
print(tokenizer.decode(outputs[0]))
高级用法
文档中未提及高级用法的相关代码,可根据实际需求对基础用法的代码进行扩展。
📚 详细文档
关于模型
评估
我们使用LogicKor代码来衡量模型性能。对于评判模型,我们使用了官方推荐的gpt-4-1106-preview。分数仅包括默认提供的0-shot评估。
模型 |
数学 |
推理 |
写作 |
编码 |
理解 |
语法 |
单轮对话 |
多轮对话 |
总体 |
Llama-VARCO-8B-Instruct |
6.71 / 8.57 |
8.86 / 8.29 |
9.86 / 9.71 |
8.86 / 9.29 |
9.29 / 10.0 |
8.57 / 7.86 |
8.69 |
8.95 |
8.82 |
EXAONE-3.0-7.8B-Instruct |
6.86 / 7.71 |
8.57 / 6.71 |
10.0 / 9.29 |
9.43 / 10.0 |
10.0 / 10.0 |
9.57 / 5.14 |
9.07 |
8.14 |
8.61 |
Meta-Llama-3.1-8B-Instruct |
4.29 / 4.86 |
6.43 / 6.57 |
6.71 / 5.14 |
6.57 / 6.00 |
4.29 / 4.14 |
6.00 / 4.00 |
5.71 |
5.12 |
5.42 |
Gemma-2-9B-Instruct |
6.14 / 5.86 |
9.29 / 9.0 |
9.29 / 8.57 |
9.29 / 9.14 |
8.43 / 8.43 |
7.86 / 4.43 |
8.38 |
7.57 |
7.98 |
Qwen2-7B-Instruct |
5.57 / 4.86 |
7.71 / 6.43 |
7.43 / 7.00 |
7.43 / 8.00 |
7.86 / 8.71 |
6.29 / 3.29 |
7.05 |
6.38 |
6.71 |
📄 许可证
本模型使用LLAMA 3.1 COMMUNITY LICENSE AGREEMENT许可证。