Downloads · 30 days
13
21% of all-time downloads
BhavanaR006/small-model-supremacy-qwen2.5-1.5b
small-model-supremacy-qwen2.5-1.5b is a text generation model from BhavanaR006. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as mit.
A fine-tuned QLoRA adapter that enables Qwen2.5-1.5B to outperform frontier models (GPT-4o, Claude 3.5 Sonnet) on structured JSON extraction from unstructured text.
Downloads · 30 days
13
21% of all-time downloads
All-time downloads
62
Public
Repo size
46.3 MB
Likes
0
Public
Click a slice to open those files.
.safetensors34.9 MB · 75%
From the Hugging Face model README
A fine-tuned QLoRA adapter that enables Qwen2.5-1.5B to outperform frontier models (GPT-4o, Claude 3.5 Sonnet) on structured JSON extraction from unstructured text.
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch, json
base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-1.5B", device_map="auto", trust_remote_code=True)
model = PeftModel.from_pretrained(base_model, "BhavanaR006/small-model-supremacy-qwen2.5-1.5b")
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-1.5B", trust_remote_code=True)
prompt = '''<|im_start|>system
You are a JSON extraction assistant. You ONLY output valid JSON. No explanations.<|im_end|>
<|im_start|>user
Extract from the following text into the schema "conference_talk_simple".
Text: Dr. Sarah Chen presented quantum error correction at NeurIPS 2025 in Vancouver.<|im_end|>
<|im_start|>assistant
'''
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
stop_id = tokenizer.encode("<|im_end|>", add_special_tokens=False)[0]
outputs = model.generate(**inputs, max_new_tokens=200, do_sample=False, eos_token_id=stop_id)
result = tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True)
print(result)
# {"speaker_name": "Dr. Sarah Chen", "topic": "quantum error correction", "conference": "NeurIPS 2025", "location": "Vancouver"}
Full source code, training pipeline, and evaluation harness: GitHub