Model Card for Model ID
<!-- ملخص: هذا النموذج هو مُكيِّف (Adapter) مُدرب بدقة باستخدام تقنية QLoRA على النموذج الأساسي
Phi-3 Mini-4K-Instruct. وظيفته الأساسية هي فهم الطلبات باللغة العربية وتحويلها إلى استدعاءات دوال
(Tool Calls) بتنسيق CALL: function_name(arg='value').
This model is a LoRA adapter fine-tuned on the Phi-3 Mini-4K-Instruct base model. Its primary function is to understand Arabic requests
and translate them into structured Tool Calling (Function Calling)
outputs using the CALL: function_name(arg='value') format.
s. -->
Model Details
Model Description
<!--Arabic (العربية):
نموذج Phi-3 Mini-4K-Instruct مُعدَّل باستخدام تقنية QLoRA.
تم تدريبه خصيصًا ليكون مساعدًا لاستدعاء الدوال (Tool Calling) باللغة العربية.
مهمته هي تحليل طلب المستخدم وتوليد استدعاء دالة نظيف ومُهيكل (Structured Function Call).
English:
A QLoRA fine-tune of Phi-3 Mini-4K-Instruct specialized in Arabic Tool Calling (Function Calling).
Its task is to analyze user requests and generate a clean,
structured function call in the format CALL: function_name(arg='value').
. -->
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
- Developed by: [Ghaadaabduallah]
- Funded by [Self-funded/Educational Project]: [More Information Needed]
- Shared by [Ghaadaabduallah]: [More Information Needed]
- Model type: [PEFT/LoRA Adapter]
- Language(s) (NLP): [Arabic (ar)]
- License: [Microsoft Phi-3 License]
- Finetuned from model [microsoft/Phi-3-mini-4k-instruct]: [More Information Needed]
Model Sources [optional]
<!-- Provide the basic links for the model. -->
- Repository: [(https://huggingface.co/Ghaadaabduallah/tasleem-phi3-lora-adapter)]
- Paper [[N/A]: [More Information Needed]
- Demo [N/A]: [More Information Needed]
Uses
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
Direct Use
<!-- Direct Use
The model is intended for direct use in AI Agent applications
where the agent needs to translate a natural Arabic language request into a specific,
executable function call (Tool Calling).. -->
[More Information Needed]
Downstream Use [optional]
<!-- Can be integrated into a larger Arabic-speaking agent workflow that connects users to external services (APIs, databases) via function calls.
-->
[More Information Needed]
Out-of-Scope Use
<!--
Long-form text generation or conversational chat (The model is specialized for the CALL: format).
Use as a general-purpose instruction-following model. -->
[More Information Needed]
Bias, Risks, and Limitations
<!-- The model inherits the biases and limitations of the base model, Phi-3 Mini-4K-Instruct. Specific limitations include:
Limited Training Data: It was fine-tuned on a small custom Arabic Tool Calling dataset (approximately 40-50 examples), limiting its ability to generalize complex or novel functions.
Context Length: The model tokenizer was limited to a max length of 1024 tokens during training.. -->
[More Information Needed]
Recommendations
<!-- Users are advised to validate the model's output in a staging environment, especially when adding new tools.
Monitoring the exact CALL: output format is crucial for reliable execution.
. -->
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
How to Get Started with the Model
To use this LoRA adapter, you must load the base Phi-3 model and then attach the LoRA weights.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
from peft import PeftModel
MODEL_NAME = "microsoft/Phi-3-mini-4k-instruct"
LORA_ADAPTER = "Ghaadaabduallah/tasleem-phi3-lora-adapter"
bnb_config = BitsAndBytesConfig(load_in_4bit=True)
1. Load the base model with 4-bit quantization
model = AutoModelForCausalLM.from_pretrained(
MODEL_NAME,
quantization_config=bnb_config,
device_map="auto",
torch_dtype=torch.float16,
)
2. Attach the LoRA adapter weights
model = PeftModel.from_pretrained(model, LORA_ADAPTER)
tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME)
The model is now ready for inference!
[More Information Needed]
Training Details
Training Data
<!-- Custom Arabic Tool Calling Dataset: A small,
custom-created dataset of approximately 40-50 highly structured examples of user requests and the corresponding function call outputs,
formatted for the Phi-3 instruction template.
. -->
[More Information Needed]
Training Procedure
<!-- Training Hyperparameters
Training regime: [bf16 mixed precision] (or fp16 mixed precision depending on the specific Colab runtime; using fp16=True in TrainingArguments usually defaults to mixed precision)
Finetuning Method: QLoRA (Quantized Low-Rank Adaptation)
LoRA Parameters: r=16, lora_alpha=32, lora_dropout=0.05
Optimizer: paged_adamw_8bit
Learning Rate: 2e−4
Epochs: 4
Target Modules: ['qkv_proj', 'o_proj'] (Attention layers critical for Phi-3)
. -->
Preprocessing [optional]
[More Information Needed]
Training Hyperparameters
- Training regime: [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
Speeds, Sizes, Times [optional]
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
[More Information Needed]
Evaluation
<!-- This section describes the evaluation protocols and provides the results. -->
Testing Data, Factors & Metrics
Testing Data
<!-- This should link to a Dataset Card if possible. -->
[More Information Needed]
Factors
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
[More Information Needed]
Metrics
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
[More Information Needed]
Results
[More Information Needed]
Summary
Model Examination [optional]
<!-- Relevant interpretability work for the model goes here -->
[More Information Needed]
Environmental Impact
<!-- Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).
y -->
Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).
- Hardware Type: [NVIDIA T4]
- Hours used: [~2 hours]
- Cloud Provider: [Google Colab / Google Cloud Platform]
- Compute Region: [More Information Needed]
- Carbon Emitted: [More Information Needed]
Technical Specifications [optional]
Model Architecture and Objective
[More Information Needed]
Compute Infrastructure
[More Information Needed]
Hardware
[More Information Needed]
Software
[More Information Needed]
Citation [optional]
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
BibTeX:
[More Information Needed]
APA:
[More Information Needed]
Glossary [optional]
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
[More Information Needed]
More Information [optional]
[More Information Needed]
Model Card Authors [optional]
[More Information Needed]
Model Card Contact
[More Information Needed]