Qwen2.5-3B Arabic LoRA (QLoRA)

محوّل LoRA مدرّب بالتقنية QLoRA لتحسين أداء نموذج Qwen2.5-3B-Instruct في اللغة العربية.

البيانات

  • المصدر: Yasbok/Alpaca_arabic_instruct (Hugging Face)
  • 3,000 مثال عربي بصيغة محادثات (system/user/assistant)
  • إعادة تحويلها إلى صيغة JSONL محادثات قبل التدريب

التدريب

  • المنصة: Kaggle (GPU Tesla P100 16GB)
  • الأداة: TRL SFTTrainer + PEFT LoraConfig + bitsandbytes (4-bit QLoRA)
  • الإعدادات: r=16, alpha=16, lr=2e-4, seq=1024, bs=2, grad_accum=4, epochs=1

الاستخدام

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

base = "Qwen/Qwen2.5-3B-Instruct"
model = AutoModelForCausalLM.from_pretrained(base, torch_dtype=torch.float16)
model = PeftModel.from_pretrained(model, "RASHID778/qwen2.5-3b-arabic-lora")
tokenizer = AutoTokenizer.from_pretrained(base)

chat = [{"role": "user", "content": "ما هو الذكاء الاصطناعي؟"}]
inputs = tokenizer.apply_chat_template(chat, tokenize=True, add_generation_prompt=True, return_tensors="pt")
out = model.generate(inputs["input_ids"], max_new_tokens=160)
print(tokenizer.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
Downloads last month
46
GGUF
Model size
29.9M params
Architecture
qwen2
Hardware compatibility
Log In to add your hardware

We're not able to determine the quantization variants.

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for RASHID778/qwen2.5-3b-arabic-lora

Base model

Qwen/Qwen2.5-3B
Adapter
(50)
this model