Instructions to use Whitewinter/model-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Whitewinter/model-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-0.6B") model = PeftModel.from_pretrained(base_model, "Whitewinter/model-lora") - Notebooks
- Google Colab
- Kaggle
File size: 1,239 Bytes
3ffe67c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | ---
license: apache-2.0
base_model: Qwen/Qwen3-0.6B
tags:
- peft
- lora
- fine-tuned
- qwen
datasets:
- tatsu-lab/alpaca
language:
- ko
- en
---
# LoRA Fine-tuned Model
์ด ๋ชจ๋ธ์ Qwen/Qwen3-0.6B์ ๊ธฐ๋ฐ์ผ๋ก LoRA(Low-Rank Adaptation) ๊ธฐ๋ฒ์ ์ฌ์ฉํด ํ์ธํ๋๋ ์ด๋ํฐ์
๋๋ค.
## ๋ชจ๋ธ ์ ๋ณด
- **๋ฒ ์ด์ค ๋ชจ๋ธ**: Qwen/Qwen3-0.6B
- **ํ์ธํ๋ ๋ฐฉ๋ฒ**: LoRA (Low-Rank Adaptation)
- **๋ฐ์ดํฐ์
**: tatsu-lab/alpaca
## ์ฌ์ฉ ๋ฐฉ๋ฒ
```python
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
# ๋ฒ ์ด์ค ๋ชจ๋ธ๊ณผ ํ ํฌ๋์ด์ ๋ก๋
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen3-0.6B", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
"Qwen/Qwen3-0.6B",
trust_remote_code=True,
torch_dtype=torch.bfloat16,
device_map="auto"
)
# LoRA ์ด๋ํฐ ๋ก๋
model = PeftModel.from_pretrained(model, "Whitewinter/model-lora")
# ์ถ๋ก
prompt = "### Instruction:\nExplain what machine learning is.\n\n### Response:\n"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=200, temperature=0.7)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
```
|