Downloads · 30 days
0
jiwon9703/KoLlama-3.1-8B-Instruct-qlora-sft-v0
KoLlama-3.1-8B-Instruct-qlora-sft-v0 is a machine learning model from jiwon9703. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as llama3.1.
이 모델은 meta-llama/Meta-Llama-3.1-8B-Instruct를 QLoRA 기법을 사용하여 한국어 instruction 데이터로 파인튜닝한 LoRA 어댑터입니다.
Downloads · 30 days
0
Access
Public
Updated Dec 15, 2025
Repo size
71.8 MB
Likes
1
Public
Click a slice to open those files.
.safetensors54.6 MB · 76%
From the Hugging Face model README
이 모델은 meta-llama/Meta-Llama-3.1-8B-Instruct를 QLoRA 기법을 사용하여 한국어 instruction 데이터로 파인튜닝한 LoRA 어댑터입니다.
이 모델은 아래 한국어 instruction 데이터셋을 결합하여 학습되었습니다:
고품질 한국어 데이터셋을 공개해주신 Markr AI 팀(Seungyoo Lee, Kyujin Han)께 진심으로 감사드립니다. 이러한 오픈 데이터셋 덕분에 한국어 언어모델 연구와 개발이 활성화되고 있습니다.
아래는 문제를 설명하는 지시사항입니다. 이 요청에 대해 적절하게 답변해주세요.
###지시사항: {instruction}
###답변:
입력이 있는 경우:
아래는 문제를 설명하는 지시사항과, 구체적인 답변의 방식을 요구하는 입력이 함께 있는 문장입니다. 이 요청에 대해 적절하게 답변해주세요.
###입력:{input}
###지시사항:{instruction}
###답변:
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
# 베이스 모델 로드
base_model_name = "meta-llama/Meta-Llama-3.1-8B-Instruct"
model = AutoModelForCausalLM.from_pretrained(
base_model_name,
torch_dtype=torch.bfloat16,
device_map="auto",
)
# LoRA 어댑터 로드
model = PeftModel.from_pretrained(
model,
"jiwon9703/KoLlama-3.1-8B-Instruct-qlora-sft-v0",
)
# Tokenizer 로드
tokenizer = AutoTokenizer.from_pretrained(base_model_name)
# 추론
prompt = "아래는 문제를 설명하는 지시사항입니다. 이 요청에 대해 적절하게 답변해주세요.\n###지시사항: 인공지능의 장점과 단점을 설명해주세요.\n###답변:"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=512,
temperature=0.7,
top_p=0.9,
do_sample=True,
)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
from peft import PeftModel
import torch
# 4-bit 양자화 설정
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_use_double_quant=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.bfloat16,
)
# 베이스 모델 로드 (4-bit)
base_model_name = "meta-llama/Meta-Llama-3.1-8B-Instruct"
model = AutoModelForCausalLM.from_pretrained(
base_model_name,
quantization_config=bnb_config,
device_map="auto",
)
# LoRA 어댑터 로드
model = PeftModel.from_pretrained(
model,
"jiwon9703/KoLlama-3.1-8B-Instruct-qlora-sft-v0",
)
tokenizer = AutoTokenizer.from_pretrained(base_model_name)
이 모델을 사용하실 경우 아래와 같이 인용해주세요:
@misc{kollama31-8b-qlora-sft-v0,
title={KoLlama-3.1-8B-Instruct QLoRA Adapter (SFT v0)},
author={jiwon9703},
year={2024},
publisher={Hugging Face},
howpublished={\url{https://huggingface.co/jiwon9703/jiwon9703/KoLlama-3.1-8B-Instruct-qlora-sft-v0}}
}
@dataset{kopen_hq_hermes_2.5_60k,
title={KOpen-HQ-Hermes-2.5-60K},
author={Lee, Seungyoo and Han, Kyujin},
organization={Markr AI},
year={2024},
url={https://huggingface.co/datasets/MarkrAI/KOpen-HQ-Hermes-2.5-60K},
license={MIT}
}
이 모델은 Meta의 Llama 3.1 Community License Agreement를 따릅니다. 자세한 내용은 Llama 3.1 License를 참조하세요.