CoolFace
Modelpublic

Alogotron/Qwen2.5-3B-JSON-StructuredOutput

sourceHugging Facemitupdated 2mo agoView on Hugging Face
0likes11downloads
Model Card

Qwen2.5-3B JSON Structured Output (LoRA)

A LoRA adapter that enhances Qwen2.5-3B-Instruct for extracting structured JSON from unstructured text.

Training Details

ParameterValue
Base ModelQwen/Qwen2.5-3B-Instruct
MethodQLoRA (4-bit NF4)
LoRA Rank16
LoRA Alpha32
Target Modulesq,k,v,o,gate,up,down
Trainable Params29.9M (1.76%)
Training Examples20 curated
Epochs5
Learning Rate5e-5
Final Loss1.506
HardwareNVIDIA RTX 3090 x2

Quick Start

python
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
from peft import PeftModel
import torch, json

bnb = BitsAndBytesConfig(load_in_4bit=True, bnb_4bit_quant_type="nf4", bnb_4bit_compute_dtype=torch.bfloat16)
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-3B-Instruct")
model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-3B-Instruct", quantization_config=bnb, device_map="auto")
model = PeftModel.from_pretrained(model, "2reb/Qwen2.5-3B-JSON-StructuredOutput")

License

MIT