Instructions to use tokhey/egyptian-mcq-generator-qwen-2.5-3b-adapter with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use tokhey/egyptian-mcq-generator-qwen-2.5-3b-adapter with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/Qwen2.5-3B-Instruct") model = PeftModel.from_pretrained(base_model, "tokhey/egyptian-mcq-generator-qwen-2.5-3b-adapter") - Transformers
How to use tokhey/egyptian-mcq-generator-qwen-2.5-3b-adapter with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tokhey/egyptian-mcq-generator-qwen-2.5-3b-adapter") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("tokhey/egyptian-mcq-generator-qwen-2.5-3b-adapter", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use tokhey/egyptian-mcq-generator-qwen-2.5-3b-adapter with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tokhey/egyptian-mcq-generator-qwen-2.5-3b-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": "tokhey/egyptian-mcq-generator-qwen-2.5-3b-adapter", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/tokhey/egyptian-mcq-generator-qwen-2.5-3b-adapter
- SGLang
How to use tokhey/egyptian-mcq-generator-qwen-2.5-3b-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 "tokhey/egyptian-mcq-generator-qwen-2.5-3b-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": "tokhey/egyptian-mcq-generator-qwen-2.5-3b-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 "tokhey/egyptian-mcq-generator-qwen-2.5-3b-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": "tokhey/egyptian-mcq-generator-qwen-2.5-3b-adapter", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use tokhey/egyptian-mcq-generator-qwen-2.5-3b-adapter with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for tokhey/egyptian-mcq-generator-qwen-2.5-3b-adapter to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for tokhey/egyptian-mcq-generator-qwen-2.5-3b-adapter to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for tokhey/egyptian-mcq-generator-qwen-2.5-3b-adapter to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="tokhey/egyptian-mcq-generator-qwen-2.5-3b-adapter", max_seq_length=2048, ) - Docker Model Runner
How to use tokhey/egyptian-mcq-generator-qwen-2.5-3b-adapter with Docker Model Runner:
docker model run hf.co/tokhey/egyptian-mcq-generator-qwen-2.5-3b-adapter
Egyptian Ministry English MCQ Generator (LoRA Adapter)
This repository contains a LoRA adapter fine-tuned on Qwen2.5-3B-Instruct for generating English multiple-choice questions following the style of the Egyptian Ministry of Education (General Secondary Stage).
Base Model
- Model:
unsloth/Qwen2.5-3B-Instruct - Fine-tuning Method: LoRA (PEFT)
- Framework: Unsloth + TRL
Task
The adapter is trained to generate ministry-style English examination questions, including:
- Grammar
- Vocabulary
- Unit-based questions
- Topic-based questions
The generated output follows a structured JSON format.
Example:
{
"questions": [
{
"statement": "...",
"correct_answer": "...",
"plausible_distractors": [
"...",
"...",
"..."
],
"explanation": "..."
}
]
}
Training Data
The adapter was trained on a synthetic dataset derived from the Egyptian secondary English curriculum.
The dataset contains prompts covering:
- Grammar Focus
- Vocabulary
- Topics
- Units
- Curriculum metadata
- Official Ministry-style multiple-choice questions
Training Configuration
- Base Model: Qwen2.5-3B-Instruct
- LoRA Rank: 16
- LoRA Alpha: 32
- LoRA Dropout: 0.05
- Sequence Length: 2048
- Optimizer: AdamW 8-bit
- Learning Rate: 1e-4
Usage
from unsloth import FastLanguageModel
from peft import PeftModel
model, tokenizer = FastLanguageModel.from_pretrained(
"unsloth/Qwen2.5-3B-Instruct",
max_seq_length=2048,
)
model = PeftModel.from_pretrained(
model,
"tokhey/egyptian-mcq-generator-qwen-2.5-3b-adapter",
)
FastLanguageModel.for_inference(model)
Intended Use
This adapter is designed for:
- Educational applications
- Automatic English exam generation
- Ministry-style assessment generation
- Question authoring assistants
It is not intended for general-purpose chat or reasoning tasks.
- Downloads last month
- 67