🚀 davidkim205/Ko-Llama-3-8B-Instruct
Ko-Llama-3-8B-Instruct是為提升韓語語言模型性能而研究的多個模型之一。該模型採用拒絕採樣(REJECTION SAMPLING)技術創建數據集,然後通過監督微調(Supervised Fine Tuning)進行訓練。
🚀 快速開始
安裝依賴
如果出現以下未定義符號錯誤,請按如下方式安裝torch:
...
RuntimeError: Failed to import transformers.models.llama.modeling_llama because of the following error (look up to see its traceback):
/home/david/anaconda3/envs/spaces/lib/python3.10/site-packages/flash_attn_2_cuda.cpython-310-x86_64-linux-gnu.so: undefined symbol: _ZN3c104cuda9SetDeviceEi
pip install torch==2.2.0
pip install flash-attn==2.5.9.post1
使用示例
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
model_id = "davidkim205/Ko-Llama-3-8B-Instruct"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
)
while True:
prompt = input('>')
messages = [
{"role": "system", "content": "당신은 구체적으로 답변하는 챗봇입니다."},
{"role": "user", "content": prompt},
]
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=1024,
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))
以下是一個詢問“사과的含義”的示例及輸出:
사과의 의미를 설명하시오
The attention mask and the pad token id were not set. As a consequence, you may observe unexpected behavior. Please pass your input's `attention_mask` to obtain reliable results.
Setting `pad_token_id` to `eos_token_id`:128009 for open-end generation.
사과는 일반적으로 맛과 영양가 있는 과일로 알려져 있습니다. 사과는 신선한 상태에서 주로 먹거나, 요거트나 스무디 등의 음료에 혼합하여 섭취되기도 합니다. 또한, 사과는 다양한 종류가 있으며, 각각의 종류는 다른 색상과 맛을 가지고 있습니다.
사과는 과일이지만, 종종 다른 의미로도 사용됩니다. 예를 들어, "사과"라는 단어는 어떤 것이 잘못되거나 부족한 것을 시사하는 상황에서 사용될 수도 있습니다. 예를 들어, "사과"를 주는 것은 잘못된 행동이나 부족한 사고로 인한 사과를 의미할 수 있습니다.
또한, "사과"는 어떤 상황에서 다른 사람에게서 사과를 받는 것을 의미하기도 합니다. 예를 들어, "사과"를 구하지 않으면 어떤 상황에서 다른 사람에게서 사과를 받지 못할 수도 있습니다.
따라서, "사과"는 다양한 의미로 사용되는 단어이며, 맥락에 따라 다른 의미를 가질 수 있습니다.
📚 詳細文檔
模型詳情
屬性 |
詳情 |
模型開發者 |
davidkim(장연 김) |
倉庫 |
- |
基礎模型 |
meta-llama/Meta-Llama-3-8B-Instruct |
SFT數據集 |
sft_rs_140k |
基準測試
kollm_evaluation
https://github.com/davidkim205/kollm_evaluation
任務 |
準確率 |
平均 |
0.47 |
kobest |
0.54 |
kobest_boolq |
0.57 |
kobest_copa |
0.62 |
kobest_hellaswag |
0.42 |
kobest_sentineg |
0.57 |
kobest_wic |
0.49 |
ko_truthfulqa |
0.29 |
ko_mmlu |
0.34 |
ko_hellaswag |
0.36 |
ko_common_gen |
0.76 |
ko_arc_easy |
0.33 |
KEval評估
KEval是一個評估模型,它學習了在使用ChatGPT評估模型的各種方法中用於評估韓語語言模型的基準測試的提示和數據集,以彌補現有的lm-evaluation-harness的不足。
https://huggingface.co/davidkim205/keval-7b
KEval |
平均 |
kullm |
logickor |
wandb |
openai/gpt-4 |
6.79 |
4.66 |
8.51 |
7.21 |
openai/gpt-3.5-turbo |
6.25 |
4.48 |
7.29 |
6.99 |
davidkim205/Ko-Llama-3-8B-Instruct |
5.59 |
4.24 |
6.46 |
6.06 |
ChatGPT評估
ChatGPT |
平均 |
kullm |
logickor |
wandb |
openai/gpt-4 |
7.30 |
4.57 |
8.76 |
8.57 |
openai/gpt-3.5-turbo |
6.53 |
4.26 |
7.5 |
7.82 |
davidkim205/Ko-Llama-3-8B-Instruct |
5.45 |
4.22 |
6.49 |
5.64 |
📄 許可證
該模型使用llama3許可證。