🚀 Dorna-Llama3-8B-Instruct模型
Dorna-Llama3-8B-Instruct是由Part AI開發的解碼器模型,基於波斯語數據進行訓練和微調。此初始版本為8B指令模型,構建於Meta Llama 3 Instruct模型之上。
🚀 快速開始
💻 使用示例
基礎用法
import torch
import transformers
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained(model_path)
model = AutoModelForCausalLM.from_pretrained(
model_path,
torch_dtype=torch.bfloat16,
device_map="auto",
)
messages = [
{"role": "system",
"content": "You are a helpful Persian assistant. Please answer questions in the asked language."},
{"role": "user", "content": "کاغذ A4 بزرگ تر است یا A5؟"},
]
input_ids = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
return_tensors="pt"
).to(model.device)
terminators = [
tokenizer.eos_token_id,
tokenizer.convert_tokens_to_ids("<|eot_id|>")
]
outputs = model.generate(
input_ids,
max_new_tokens=256,
eos_token_id=terminators,
do_sample=True,
temperature=0.6,
top_p=0.9,
)
response = outputs[0][input_ids.shape[-1]:]
print(tokenizer.decode(response, skip_special_tokens=True))
你也可以使用下面的筆記本在Google Colab中測試該模型。

📚 詳細文檔
模型詳情
Dorna系列模型是僅解碼器模型家族,專門針對波斯語數據進行訓練和微調,由Part AI開發。作為初始版本,現推出該家族的8B指令模型。
Dorna-Llama3-8B-Instruct基於Meta Llama 3 Instruct模型構建。
評估
該模型在各種任務的問題上進行了評估,包括布爾問題、代碼生成、長文本回復、數學問題、新聞問答、釋義、常識問答和文本摘要。大多數類別通常有兩個主要難度級別:困難和簡單。
評估包括人工評估和自動評估(以GPT - 4作為評判)。
在兩個表格中,Dorna-8B-it 是 Dorna-Llama3-8B-Instruct 的縮寫形式。
整體人工評估結果
模型對比 |
參數 |
勝率 % |
敗率 % |
平局率 % |
Dorna-8B-it vs. Meta-Llama-3-8B-Instruct |
8B |
36.94 |
17.39 |
45.67 |
Dorna-8B-it vs. GPT 3.5 turbo-1106 |
N.A. |
32.01 |
26.94 |
41.05 |
Dorna-8B-it vs. Persian Mind |
7B |
55.77 |
10.49 |
33.74 |
分類人工評估結果
每個類別報告了勝/敗/平的百分比。
模型對比 |
參數 |
複雜布爾問題 |
簡單布爾問題 |
代碼生成 |
通用長回覆 |
歷史長回覆 |
複雜數學問題 |
簡單數學問題 |
複雜新聞問答 |
簡單新聞問答 |
釋義 |
簡單常識問答 |
困難常識問答 |
文本摘要 |
Dorna-8B-it vs. Meta-Llama-3-8B-Instruct |
8B |
0.25/0.25/0.5 |
0.28/0.35/0.38 |
0.6/0.1/0.3 |
0.8/0.08/0.12 |
0.4/0.3/0.3 |
0.28/0.08/0.65 |
0.47/0.00/0.53 |
0.55/0.07/0.38 |
0.43/0.15/0.42 |
0.1/0.05/0.85 |
0.31/0.2/0.49 |
0.59/0.13/0.28 |
0.28/0.2/0.53 |
Dorna-8B-it vs. GPT 3.5 turbo-1106 |
N.A. |
0.35/0.35/0.3 |
0.3/0.3/0.4 |
0.1/0.3/.06 |
0.2/0.45/0.35 |
0.46/0.27/0.27 |
0.25/0.1/0.65 |
0.05/0.1/0.85 |
0.12/0.35/0.53 |
0.15/0.1/0.75 |
0.25/0.15/0.6 |
0.3/0.32/0.38 |
0.22/0.53/0.25 |
0.35/0.55/0.1 |
Dorna-8B-it vs. Persian Mind |
7B |
0.47/0.25/0.28 |
0.57/0.15/0.28 |
0.9/0.1/0.0 |
0.82/0.08/0.1 |
0.4/0.17/0.42 |
0.3/0.0/0.7 |
0.22/0.08/0.7 |
0.72/0.07/0.2 |
0.7/0.0/0.3 |
0.7/0.05/0.25 |
0.51/0.12/0.37 |
0.61/0.1/0.29 |
0.93/0.0/0.07 |
自動評估結果
模型對比 |
參數 |
總體勝率 % |
簡單問題勝率 % |
困難問題勝率 % |
Dorna-8B-it vs. Llama 3 base |
8B |
58.96 |
56.00 |
64.49 |
Dorna-8B-it vs. Part Mistral |
7B |
77.20 |
73.00 |
85.05 |
Dorna-8B-it vs. Persian Mind |
7B |
90.88 |
87.50 |
97.20 |
Dorna-8B-it vs. Neuraorca Gemma 7b |
7B |
86.32 |
86.50 |
85.98 |
Dorna-8B-it vs. Maral 7b |
7B |
97.39 |
97.00 |
98.13 |
Dorna-8B-it vs. PersianLlama 7b |
7B |
98.70 |
98.00 |
100.00 |
Dorna-8B-it vs. Aya-23-8B |
8B |
52.77 |
56.50 |
45.79 |
Dorna-8B-it vs. Aya-23-35B |
35B |
45.93 |
54.00 |
30.84 |
Dorna-8B-it vs. Command R |
35B |
58.63 |
61.00 |
54.21 |
📄 許可證
本模型使用的許可證為llama3。
🔗 聯繫我們
如果你對該模型有任何疑問,可以通過Hugging Face上的社區聯繫我們。