Instructions to use Belkacemdz/allam-deepbac-adapter with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Belkacemdz/allam-deepbac-adapter with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("ALLaM-AI/ALLaM-7B-Instruct-preview") model = PeftModel.from_pretrained(base_model, "Belkacemdz/allam-deepbac-adapter") - Transformers
How to use Belkacemdz/allam-deepbac-adapter with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Belkacemdz/allam-deepbac-adapter") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Belkacemdz/allam-deepbac-adapter", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Belkacemdz/allam-deepbac-adapter with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Belkacemdz/allam-deepbac-adapter" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Belkacemdz/allam-deepbac-adapter", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Belkacemdz/allam-deepbac-adapter
- SGLang
How to use Belkacemdz/allam-deepbac-adapter with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Belkacemdz/allam-deepbac-adapter" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Belkacemdz/allam-deepbac-adapter", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Belkacemdz/allam-deepbac-adapter" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Belkacemdz/allam-deepbac-adapter", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Desktop
- Docker Model Runner
How to use Belkacemdz/allam-deepbac-adapter with Docker Model Runner:
docker model run hf.co/Belkacemdz/allam-deepbac-adapter
language:
- ar
license: apache-2.0
library_name: peft
pipeline_tag: text-generation
base_model: ALLaM-AI/ALLaM-7B-Instruct-preview
tags: - allam - arabic - qlora - lora - peft - unsloth - transformers - trl - education - question-answering - deepbac
DeepBac ALLaM QLoRA Adapter
This repository contains a QLoRA adapter obtained by fine-tuning ALLaM-7B-Instruct-preview for the DeepBac project.
The adapter is designed to improve Arabic educational question answering and student support for the Algerian Baccalaureate.
Note: This repository contains only the QLoRA adapter weights. The original ALLaM model is not included.
Model Information
| Item | Value |
|---|---|
| Base Model | ALLaM-AI/ALLaM-7B-Instruct-preview |
| Fine-tuning Method | QLoRA |
| Framework | Unsloth |
| PEFT Method | LoRA |
| Task | Instruction Following / Question Answering |
| Language | Arabic |
| Domain | Education |
Training Configuration
The adapter was trained using the following configuration:
| Parameter | Value |
|---|---|
| Quantization | 4-bit |
| LoRA Rank (r) | 16 |
| LoRA Alpha | 16 |
| LoRA Dropout | 0 |
| Optimizer | AdamW 8-bit |
| Learning Rate | 2e-4 |
| Epochs | 5 |
| Batch Size | 2 |
| Gradient Accumulation | 4 |
| Maximum Sequence Length | 2048 |
Target modules:
- q_proj
- k_proj
- v_proj
- o_proj
- gate_proj
- up_proj
- down_proj
Intended Use
This adapter is intended for:
- Arabic educational assistants
- Educational question answering
- Student tutoring
- Personalized learning
- AI-assisted education
Loading the Adapter
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base_model = AutoModelForCausalLM.from_pretrained(
"ALLaM-AI/ALLaM-7B-Instruct-preview"
)
model = PeftModel.from_pretrained(
base_model,
"Belkacemdz/allam-deepbac-adapter"
)
tokenizer = AutoTokenizer.from_pretrained(
"ALLaM-AI/ALLaM-7B-Instruct-preview"
)
Limitations
This adapter was fine-tuned specifically for educational applications.
Performance outside educational and Arabic question-answering tasks has not been evaluated.
License
This repository distributes only the QLoRA adapter.
The original ALLaM model remains subject to its own license and terms of use.
Author
Developed by Belkacem Achraf ZAGHEZ
Master's Student in Artificial Intelligence
University of Biskra, Algeria
- Downloads last month
- 6
Model tree for Belkacemdz/allam-deepbac-adapter
Base model
humain-ai/ALLaM-7B-Instruct-preview