Downloads · 30 days
15
3% of all-time downloads
daichira/haiku-qwen3-4b-lora-unsloth
haiku-qwen3-4b-lora-unsloth is a machine learning model from daichira. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft. The card lists the license as other.
This repository contains LoRA adapter weights fine-tuned with Unsloth/TRL to compose Japanese haiku that follow the 5-7-5 pattern and include a given kigo (seasonal word).
Downloads · 30 days
15
3% of all-time downloads
All-time downloads
437
Public
Repo size
1.3 GB
Likes
0
Public
Click a slice to open those files.
.safetensors132 MB · 89%
From the Hugging Face model README
This repository contains LoRA adapter weights fine-tuned with Unsloth/TRL to compose Japanese haiku that follow the 5-7-5 pattern and include a given kigo (seasonal word).
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base_model = "Qwen/Qwen3-4B-Instruct-2507"
adapter_id = "daichira/haiku-qwen3-4b-lora-unsloth"
tok = AutoTokenizer.from_pretrained(base_model, trust_remote_code=True, use_fast=True)
base = AutoModelForCausalLM.from_pretrained(base_model, device_map="auto", trust_remote_code=True)
model = PeftModel.from_pretrained(base, adapter_id)
messages = [
{"role":"system","content":"あなたは一流の俳人です。5-7-5を厳守し、必ず季語を含め、俳句一首のみを出力してください。"},
{"role":"user","content":"季語: 桜\n季節: 春\n一首だけ。"},
]
prompt = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tok(prompt, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=64, do_sample=True, top_p=0.9, temperature=0.7)
print(tok.decode(out[0], skip_special_tokens=True))
Note: This repo only ships LoRA adapters, not the full base model.