Downloads · 30 days
8
5% of all-time downloads
tokhey/Qwen2.5-3B-Egyptian-MCQ
Qwen2.5-3B-Egyptian-MCQ is a machine learning model from tokhey. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
A fine-tuned Qwen2.5-3B-Instruct model specialized in generating English multiple-choice questions that closely follow the style of the Egyptian Ministry of Education (General Secondary Stage). The model was instructi…
Downloads · 30 days
8
5% of all-time downloads
All-time downloads
171
Public
Parameters
3.1B
6.2 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors6.2 GB · 100%
From the Hugging Face model README
A fine-tuned Qwen2.5-3B-Instruct model specialized in generating English multiple-choice questions that closely follow the style of the Egyptian Ministry of Education (General Secondary Stage). The model was instruction-tuned using LoRA (PEFT) on a synthetic dataset designed to teach the model the structure, difficulty, and writing style of official Egyptian English examinations.
| Property | Value |
|---|---|
| Base Model | Qwen/Qwen2.5-3B-Instruct |
| Fine-tuning Method | LoRA (PEFT) |
| Training Framework | Unsloth + TRL |
| Inference | Hugging Face Transformers / vLLM |
| Precision | FP16 |
The model was trained on a synthetic instruction dataset specifically designed for Egyptian Ministry English examinations.
| Split | Samples |
|---|---|
| Training | ~5,751 |
| Validation | ~640 |
| Total | ~6,400 |
The dataset contains instruction-response conversations covering:
The model always returns structured JSON. Example:
{
"questions": [
{
"statement": "...",
"correct_answer": "...",
"plausible_distractors": [
"...",
"...",
"..."
],
"explanation": "..."
}
]
}
You are a Senior English Assessment Specialist and an official item writer for the Egyptian Ministry of Education.
Generate authentic English examination questions.
Return ONLY valid JSON.
Generate 10 grammar questions.
Grammar Focus:
Past Perfect / Past Perfect Continuous
Return only valid JSON.
The model supports requests such as:
| Parameter | Value |
|---|---|
| Base Model | Qwen2.5-3B-Instruct |
| LoRA Rank | 16 |
| LoRA Alpha | 32 |
| LoRA Dropout | 0.05 |
| Learning Rate | 1e-4 |
| Epochs | 2 |
| Optimizer | AdamW 8-bit |
| Maximum Sequence Length | 2048 |
Install the required libraries:
pip install transformers torch
Load the model:
from transformers import AutoTokenizer, AutoModelForCausalLM
MODEL_ID = "tokhey/Qwen2.5-3B-Egyptian-MCQ"
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
model = AutoModelForCausalLM.from_pretrained(
MODEL_ID,
torch_dtype="auto",
device_map="auto",
)
Prepare the conversation:
messages = [
{
"role": "system",
"content": SYSTEM_PROMPT
},
{
"role": "user",
"content": USER_PROMPT
}
]
Apply the chat template:
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
)
Generate:
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=1200,
temperature=0.7,
top_p=0.9,
)
response = tokenizer.decode(
outputs[0][inputs.input_ids.shape[1]:],
skip_special_tokens=True,
)
print(response)
Start the server:
python -m vllm.entrypoints.openai.api_server \
--model tokhey/Qwen2.5-3B-Egyptian-MCQ
Or use Python:
from vllm import LLM
from vllm import SamplingParams
llm = LLM(
model="tokhey/Qwen2.5-3B-Egyptian-MCQ"
)
sampling_params = SamplingParams(
temperature=0.7,
top_p=0.9,
max_tokens=1200,
)
Generate:
outputs = llm.generate(
text ,
sampling_params,
)
print(outputs[0].outputs[0].text)
This model is intended for:
This project follows the same license as the base model (Qwen2.5-3B-Instruct). Please refer to the base model repository for licensing details.