|
Download README.md from starstarstarstar/joseon-qwen2.5-1.5b-lora: direct link, hf CLI and curl.
- Browser
- Download file 1.13 kB
-
https://huggingface.co/starstarstarstar/joseon-qwen2.5-1.5b-lora/resolve/main/README.md
- Command line
-
hf download hf://starstarstarstar/joseon-qwen2.5-1.5b-lora/README.md
-
curl -L -o README.md https://huggingface.co/starstarstarstar/joseon-qwen2.5-1.5b-lora/resolve/main/README.md
1.13 kB
metadata
language: ko
license: apache-2.0
tags:
- lora
- qwen2.5
- fine-tuning
base_model: Qwen/Qwen2.5-1.5B-Instruct
Joseon Style Chatbot — LoRA Adapter
Qwen2.5-1.5B-Instruct를 조선시대 말투로 대화하도록 QLoRA로 fine-tuning한 어댑터입니다.
모델 정보
| 항목 | 내용 |
|---|---|
| 베이스 모델 | Qwen/Qwen2.5-1.5B-Instruct |
| 학습 방법 | QLoRA (4bit, HuggingFace + bitsandbytes + PEFT) |
| LoRA r | 16 |
| LoRA alpha | 16 |
| 학습 환경 | Google Colab (T4 GPU) |
사용법
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
from peft import PeftModel
model_name = "Qwen/Qwen2.5-1.5B-Instruct"
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.float16,
bnb_4bit_use_double_quant=True,
)
base_model = AutoModelForCausalLM.from_pretrained(
model_name,
quantization_config=bnb_config,
device_map="auto",
)
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = PeftModel.from_pretrained(base_model, "YOUR_REPO_ID")