Downloads · 30 days
50
35% of all-time downloads
RASHID778/qwen2.5-3b-arabic-lora
qwen2.5-3b-arabic-lora is a text generation model from RASHID778. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
محوّل LoRA مدرّب بالتقنية QLoRA لتحسين أداء نموذج Qwen2.5-3B-Instruct في اللغة العربية.
Downloads · 30 days
50
35% of all-time downloads
All-time downloads
141
Public
Repo size
191 MB
Likes
0
Public
Click a slice to open those files.
.safetensors120 MB · 63%
From the Hugging Face model README
محوّل LoRA مدرّب بالتقنية QLoRA لتحسين أداء نموذج Qwen2.5-3B-Instruct في اللغة العربية.
Yasbok/Alpaca_arabic_instruct (Hugging Face)SFTTrainer + PEFT LoraConfig + bitsandbytes (4-bit QLoRA)r=16, alpha=16, lr=2e-4, seq=1024, bs=2, grad_accum=4, epochs=1import 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))