kamonwit/dapt-qwen3-4b-thai-law-lora
010
Thai Legal Domain-Adapted Qwen3-4B-Thinking
This model is a domain-adapted version of Qwen/Qwen3-4B-Thinking-2507 fine-tuned on Thai legal documents including:
- ประมวลกฎหมายแพ่งและพาณิชย์ (Civil and Commercial Code)
- ประมวลรัษฎากร (Tax Revenue Code)
- Court case judgments
Training Details
- Base Model: Qwen/Qwen3-4B-Thinking-2507
- Training Method: LoRA (Low-Rank Adaptation) with Unsloth
- Sequence Length: 2048
- Learning Rate: 1e-05
- Epochs: 1
Usage
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained(
model_name="kamonwit/qwen3-4b-thai-law-dapt",
max_seq_length=2048,
dtype=None,
load_in_4bit=True,
)
# Enable inference mode
FastLanguageModel.for_inference(model)
# Generate text
inputs = tokenizer("ตามประมวลกฎหมายแพ่งและพาณิชย์", return_tensors="pt")
outputs = model.generate(**inputs, max_length=200, do_sample=True, temperature=0.7)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)Note
This is a LoRA adapter that needs to be loaded with the base model. For standalone usage, use the merged version if available.
Framework versions
- PEFT 0.17.1
