Qwen2.5-1.5B-Bangla (Full Dataset Fine-Tuned)
This model is a parameter-efficient fine-tuned (PEFT) LoRA adapter on top of Qwen/Qwen2.5-1.5B-Instruct, trained on the complete shuvo-halder/Shikha-Bengali-Alpaca dataset (~51,760 instruction-response pairs).
It was trained using a two-stage sequential LoRA fine-tuning strategy (50% + 50%) on a single NVIDIA Tesla T4 GPU, making it a robust, lightweight, and responsive Bengali conversational assistant.
Model Details
Model Description
- Developed by: shuvo-halder
- Model type: Causal Language Model (LoRA Adapter)
- Language(s) (NLP): Bengali (
bn), English (en) - License: Apache-2.0
- Finetuned from model:
Qwen/Qwen2.5-1.5B-Instruct - Methodology: Parameter-Efficient Fine-Tuning (PEFT) via LoRA
Sequential Training Strategy (100% Data Coverage)
To prevent resource exhaustion and session timeouts on free-tier cloud GPUs (Google Colab), the training was executed in two sequential stages across the full 51,760 samples:
| Stage | Dataset Split | Examples | Learning Rate | Status |
|---|---|---|---|---|
| Stage 1 (Initial 50%) | train[:50%] |
~25,880 | 2e-4 |
Completed |
| Stage 2 (Final 50%) | train[50%:] |
~25,880 | 1e-4 |
Completed |
- By reducing the learning rate to
1e-4during Stage 2, the model assimilated the remainder of the dataset without experiencing catastrophic forgetting of the first half.
Uses
Direct Use
- Conversational chat in standard Bengali.
- Answering questions, summarizing text, creative writing, and following complex multi-turn instructions in Bengali.
- Translating or explaining general and technical concepts in Bengali.
Out-of-Scope Use
- Critical decision-making in legal, medical, or financial matters without professional verification.
- Generating harmful, offensive, or biased content.
Bias, Risks, and Limitations
- Hallucinations: As a compact 1.5B model, it may occasionally generate plausible-sounding but factually inaccurate responses.
- Dataset Artifacts: The training data is derived from the Bengali translation of Stanford Alpaca. Occasional translation phrasing quirks may surface.
- Context Length: Best suited for prompts and responses within a 512–1024 token window.
How to Get Started with the Model
Use the snippet below to load and run inference with 🤗 transformers and peft:
import torch
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base_model_id = "Qwen/Qwen2.5-1.5B-Instruct"
adapter_id = "shuvo-halder/Qwen2.5-1.5B-Bangla"
# ১. টোকেনাইজার এবং বেস মডেল লোড
tokenizer = AutoTokenizer.from_pretrained(base_model_id)
base_model = AutoModelForCausalLM.from_pretrained(
base_model_id,
torch_dtype=torch.float16,
device_map="auto"
)
# ২. ফাইন-টিউনড LoRA অ্যাডাপ্টার লোড করা
model = PeftModel.from_pretrained(base_model, adapter_id)
model.eval()
# ৩. বাংলায় চ্যাট প্রম্পট তৈরি
user_question = "নিয়মিত বই পড়ার উপকারিতা কী কী?"
messages = [{"role": "user", "content": user_question}]
prompt = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
# ৪. উত্তর জেনারেট করা
with torch.no_grad():
outputs = model.generate(
**inputs,
max_new_tokens=256,
temperature=0.7,
top_p=0.9,
repetition_penalty=1.1,
do_sample=True,
pad_token_id=tokenizer.eos_token_id
)
input_length = inputs["input_ids"].shape[1]
response = tokenizer.decode(outputs[0][input_length:], skip_special_tokens=True)
print("উত্তর:\n", response.strip())