🚀 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許可證。