Model
- base model: meta-llama/Meta-Llama-3-8B-Instruct
- parent model: DavidAhn/Llama-3-8B-slerp-262k
Dataset
Load Model
Use the following Python code to load the model:
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("youjunhyeok/Llama-3-8B-slerp-262k-sft-lora-ko-v2")
model = AutoModelForCausalLM.from_pretrained("youjunhyeok/Llama-3-8B-slerp-262k-sft-lora-ko-v2")
Chat
conversation = [ {'role': 'user', 'content': '역사상 가장 위대한 인물은 누구야?'} ]
prompt = tokenizer.apply_chat_template(conversation, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, use_cache=False, max_length=1024)
output_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(output_text)
Output
system
You are a helpful assistant.user
system
You are a helpful assistant.user
역사상 가장 위대한 인물은 누구야?assistant
저는 인공지능으로서 개인적인 의견을 가지고 있지 않습니다.
하지만 역사상 가장 위대한 인물에 대한 다양한 의견이 존재하며, 이는 개인의 관점과 문화적 배경에 따라 달라질 수 있습니다.
어떤 사람들은 마하트마 간디, 넬슨 만델라, 마틴 루터 킹 주니어, 알버트 아인슈타인, 아리스토텔레스, 윌리엄 셰익스피어와 같은 인물들을 위대한 인물로 꼽기도 합니다.
하지만 이는 개인적인 의견일 뿐이며, 역사상 가장 위대한 인물에 대한 논쟁은 계속되고 있습니다.
BenchMark (KOR)
# alias
A = youjunhyeok/Llama-3-8B-slerp-262k-sft-lora-ko-v2
B = DavidAhn/Llama-3-8B-slerp-262k
C = meta-llama/Meta-Llama-3-8B
D = chihoonlee10/T3Q-ko-solar-dpo-v7.0 (24.05.24 ko 리더보드 1등)
Benchmark (macro_f1) | A | B | C | D |
---|---|---|---|---|
kobest_boolq (0-shot) | 43.6 | 33.5 | 38.2 | 34.1 |
kobest_boolq (5-shot) | 82.0 | 68.8 | 83.8 | 93.1 |
kobest_copa (0-shot) | 69.2 | 58.5 | 63.1 | 81.0 |
kobest_copa (5-shot) | 74.8 | 61.7 | 69.1 | 91.0 |
kobest_hellaswag (0-shot) | 47.5 | 43.2 | 42.1 | 55.1 |
kobest_hellaswag (5-shot) | 49.4 | 45.3 | 44.2 | 55.2 |
kobest_sentineg (0-shot) | 59.9 | 34.8 | 51.5 | 82.7 |
kobest_sentineg (5-shot) | 84.2 | 85.8 | 94.7 | 91.4 |
BenchMark (ENG)
openbookqa | hellaswag | boolq | arc_easy | arc_challenge | |
---|---|---|---|---|---|
youjunhyeok/Llama-3-8B-slerp-262k-sft-lora-ko-v2 | 0.300 | 0.564 | 0.685 | 0.715 | 0.448 |
DavidAhn/Llama-3-8B-slerp-262k | 0.312 | 0.587 | 0.832 | 0.808 | 0.518 |
meta-llama/Meta-Llama-3-8B-Instruct | 0.338 | 0.576 | 0.831 | 0.815 | 0.529 |
Llama_factory Train Command
{data_dir}, {dataset_name}, {output_dir} is variable
CUDA_VISIBLE_DEVICES=0 llamafactory-cli train \
--stage sft \
--do_train True \
--model_name_or_path DavidAhn/Llama-3-8B-slerp-262k \
--preprocessing_num_workers 16 \
--finetuning_type lora \
--template default \
--flash_attn auto \
--dataset_dir {data_dir} \
--dataset {dataset_name} \
--cutoff_len 1024 \
--learning_rate 5e-05 \
--num_train_epochs 3.0 \
--max_samples 99999999999 \
--per_device_train_batch_size 16 \
--gradient_accumulation_steps 4 \
--lr_scheduler_type cosine \
--max_grad_norm 1.0 \
--logging_steps 50 \
--save_steps 5000 \
--warmup_steps 1000 \
--optim adamw_torch \
--resize_vocab True \
--packing False \
--report_to none \
--output_dir {output_dir} \
--fp16 True \
--plot_loss True \
--lora_rank 8 \
--lora_alpha 16 \
--lora_dropout 0 \
--lora_target q_proj,v_proj
- Downloads last month
- 1,549
This model does not have enough activity to be deployed to Inference API (serverless) yet.
Increase its social visibility and check back later, or deploy to Inference Endpoints (dedicated)
instead.