Downloads · 30 days
0
vishnuamarapu/Full-Fine-Tuning-Qwen-2.5-0.5B-instruct-sft-prefix-tuned
Full-Fine-Tuning-Qwen-2.5-0.5B-instruct-sft-prefix-tuned is a machine learning model from vishnuamarapu. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This repository contains a Prefix Tuning (PEFT) adapter trained on top of my Supervised Fine-Tuned (SFT) personalized Qwen model.
Downloads · 30 days
0
Access
Public
Updated Jun 27, 2026
Repo size
11.9 MB
Likes
0
Public
Click a slice to open those files.
.json11.4 MB · 96%
From the Hugging Face model README
This repository contains a Prefix Tuning (PEFT) adapter trained on top of my Supervised Fine-Tuned (SFT) personalized Qwen model.
Instead of updating all model weights, Prefix Tuning learns a small set of trainable prefix key/value vectors while keeping the underlying language model completely frozen. This significantly reduces the number of trainable parameters while retaining the personalized knowledge learned during supervised fine-tuning.
Note: This repository contains only the Prefix Tuning adapter, not the complete language model. To use this adapter, you must first load the corresponding SFT model.
This Prefix Tuning adapter was trained on the following model:
BASE_MODEL = "vishnuamarapu/Full-Fine-Tuning-Qwen-2.5-0.5B-instruct-sft"
Do not load the original Qwen/Qwen2.5-0.5B-Instruct model directly, as the adapter was trained specifically on the personalized SFT model.
pip install -U transformers peft accelerate torch
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
BASE_MODEL = "vishnuamarapu/Full-Fine-Tuning-Qwen-2.5-0.5B-instruct-sft"
PREFIX_ADAPTER = (
"vishnuamarapu/"
"Full-Fine-Tuning-Qwen-2.5-0.5B-instruct-sft-prefix-tuned"
)
tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL)
model = AutoModelForCausalLM.from_pretrained(
BASE_MODEL,
device_map="auto",
torch_dtype="auto"
)
model = PeftModel.from_pretrained(
model,
PREFIX_ADAPTER
)
messages = [
{
"role": "system",
"content": (
"You are Vishnu's personal AI assistant. "
"Answer questions about Vishnu."
)
},
{
"role": "user",
"content": "What is your name?"
}
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
inputs = tokenizer(
text,
return_tensors="pt"
).to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=80,
do_sample=False
)
response = tokenizer.decode(
outputs[0],
skip_special_tokens=True
)
print(response)
adapter_config.json
adapter_model.safetensors
chat_template.jinja
tokenizer.json
tokenizer_config.json
training_args.bin
The repository stores only the Prefix Tuning adapter, making it lightweight and efficient to distribute.
This adapter is intended for:
Please follow the license terms of the underlying Qwen model when using this adapter.