Model Card for qwen2_5_0_5b-capybara-lora

This model is a fine-tuned version of Qwen/Qwen2.5-0.5B-Instruct. It has been trained using TRL.

Purpose

This LoRA adapter was trained as a learning and pipeline validation run. The training was intentionally kept very short to:

  • verify GPU and CUDA setup
  • test LoRA fine-tuning with TRL
  • validate saving, loading, and local inference

This checkpoint is not intended to be a converged or production model. For better performance, longer training on larger GPUs is recommended.

Quick start

This repository contains a LoRA adapter, not a fully merged model. Load it by combining the base model with the adapter:

import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel

base_model_id = "Qwen/Qwen2.5-0.5B-Instruct"
adapter_id = "pelinbalci/qwen2_5_0_5b-capybara-lora"

tokenizer = AutoTokenizer.from_pretrained(adapter_id)
base = AutoModelForCausalLM.from_pretrained(
    base_model_id,
    torch_dtype=torch.float16,
    device_map="auto",
)

model = PeftModel.from_pretrained(base, adapter_id)
model.eval()

prompt = "Explain LoRA fine-tuning in simple terms."
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)

with torch.no_grad():
    output = model.generate(**inputs, max_new_tokens=128)

print(tokenizer.decode(output[0], skip_special_tokens=True))

Training procedure

This model was trained with SFT.

Training details

  • Training type: Supervised Fine-Tuning (SFT)
  • Method: LoRA (PEFT)
  • Max training steps: 3
  • Hardware: NVIDIA GTX 1050 (4GB)
  • Precision: fp16

Framework versions

  • PEFT 0.18.1
  • TRL: 0.26.2
  • Transformers: 4.57.5
  • Pytorch: 2.7.1+cu118
  • Datasets: 4.5.0
  • Tokenizers: 0.22.2

Citations

Cite TRL as:

@misc{vonwerra2022trl,
    title        = {{TRL: Transformer Reinforcement Learning}},
    author       = {Leandro von Werra and Younes Belkada and Lewis Tunstall and Edward Beeching and Tristan Thrush and Nathan Lambert and Shengyi Huang and Kashif Rasul and Quentin Gallou{\'e}dec},
    year         = 2020,
    journal      = {GitHub repository},
    publisher    = {GitHub},
    howpublished = {\url{https://github.com/huggingface/trl}}
}
Downloads last month
2
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for pelinbalci/qwen2_5_0_5b-capybara-lora-gpu1050

Adapter
(499)
this model