๐ MohammedNaaser/silma_9b_instruct_ft ๐
๐ Fine-Tuned Arabic Language Model for Enhanced Reasoning and Instructive Tasks ๐
๐ง Model Overview
Welcome to silma_9b_instruct_ft
, an advanced fine-tuned version of the SILMA-9B-Instruct, crafted to boost reasoning capabilities and improve response quality in Arabic-language tasks. This model is tailored for causal language modeling (CAUSAL_LM) and has been optimized using parameter-efficient fine-tuning (PEFT) with LoraConfig.
๐ง Key Features
- Reasoning Enhancement ๐งฉ: Fine-tuned specifically for handling complex reasoning tasks in Arabic.
- PEFT for Efficient Fine-Tuning ๐: Employs the LoRA (Low-Rank Adaptation) technique for lightweight and effective fine-tuning.
- Customizable Attention ๐ฏ: Incorporates custom attention modules (
q_proj
,k_proj
,v_proj
, etc.) to tailor focus during task processing.
๐ฏ Usage
Here's how to load and start using the model for inference or further fine-tuning:
from transformers import AutoTokenizer, AutoModelForCausalLM
# Load the tokenizer and model
tokenizer = AutoTokenizer.from_pretrained("MohammedNaaser/silma_9b_instruct_ft")
model = AutoModelForCausalLM.from_pretrained("MohammedNaaser/silma_9b_instruct_ft")
# Example inference
input_text = """
ูู ุฅุญุฏู ุงูุฃูุนุงุจุ ูุฑุจุญ ุงููุงุนุจ 3 ููุงุท ุฅุฐุง ูุงุฒุ ููุฎุณุฑ ููุทุชูู ุฅุฐุง ุฎุณุฑ
ุููุง ูุญุตู ุนูู ุฃู ููุงุท ุฅุฐุง ุชุนุงุฏู.
ุฅุฐุง ูุนุจ 20 ู
ุจุงุฑุงุฉ ูุงูุชูู ุจุฑุตูุฏ 15 ููุทุฉุ
ูู
ุง ุฃูู ุนุฏุฏ ู
ู ุงูู
ุจุงุฑูุงุช ุงูุชู ูู
ูู ุฃู ูููู ูุฏ ูุงุฒ ุจูุงุ
""""
inputs = tokenizer(input_text, return_tensors="pt")
outputs = model.generate(**inputs)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
๐ Deployment with Hugging Face Spaces and Gradio
Want to deploy your own interactive chat or Q&A system using this model? Check out Gradio for creating simple UIs!
Create Your Space Here!
โ๏ธ Training Setup
๐ Fine-Tuning Parameters
- Base Model:
silma-ai/SILMA-9B-Instruct-v1.0
- Trainer:
SFTTrainer
from TRL - Quantization Config:
BitsAndBytesConfig
(4-bit withnf4
type) - LoRA Parameters:
lora_alpha
: 16lora_dropout
: 0.1lora_r
: 4- Target modules:
q_proj
,k_proj
,v_proj
,o_proj
,gate_proj
,up_proj
,down_proj
๐ ๏ธ File Overview
After saving the fine-tuned model, the following files are generated:
adapter_config.json
: Configuration file for LoRA adapters.adapter_model.safetensor
: Serialized fine-tuned model weights.tokenizer.json
,tokenizer_config.json
: Tokenizer configuration files.special_tokens_map.json
: Mapping for special tokens like[BOS]
and[EOS]
.tokenizer.model
: The model used for tokenization.
๐ License & Citation
This model is released under the Apache License. If you use it in your work, please consider citing the original SILMA model and the fine-tuning method as follows:
@misc{MohammedNasser_silma9b_ft,
author = {Mohammed Nasser},
title = {Fine-Tuning Arabic Instructive Models with PEFT and LoRA},
year = {2024},
url = {https://huggingface.co/MohammedNaaser/silma_9b_instruct_ft},
}
๐งโ๐ป Contributing
Contributions are welcome! If you find any issues or would like to improve this model further, feel free to open an issue or submit a pull request. Let's push the boundaries of Arabic NLP together!
- Downloads last month
- 120
Model tree for MohammedNasser/reasoning-silma-1.0-9b
Base model
silma-ai/SILMA-9B-Instruct-v1.0