Instructions to use tokhey/question-generator-model-qwen2.5-1.5b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tokhey/question-generator-model-qwen2.5-1.5b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tokhey/question-generator-model-qwen2.5-1.5b") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("tokhey/question-generator-model-qwen2.5-1.5b") model = AutoModelForCausalLM.from_pretrained("tokhey/question-generator-model-qwen2.5-1.5b", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use tokhey/question-generator-model-qwen2.5-1.5b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tokhey/question-generator-model-qwen2.5-1.5b" # 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/question-generator-model-qwen2.5-1.5b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/tokhey/question-generator-model-qwen2.5-1.5b
- SGLang
How to use tokhey/question-generator-model-qwen2.5-1.5b 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/question-generator-model-qwen2.5-1.5b" \ --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/question-generator-model-qwen2.5-1.5b", "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/question-generator-model-qwen2.5-1.5b" \ --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/question-generator-model-qwen2.5-1.5b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use tokhey/question-generator-model-qwen2.5-1.5b with Docker Model Runner:
docker model run hf.co/tokhey/question-generator-model-qwen2.5-1.5b
Egyptian Ministry English Exam Question Generator (Qwen2.5-1.5B)
This model is a fine-tuned version of Qwen2.5-1.5B-Instruct designed to generate English multiple-choice questions that closely resemble the official examinations of the Egyptian Ministry of Education (General Secondary Stage).
Unlike generic question generation models, this model was trained specifically to reproduce the wording, structure, difficulty, distractor quality, and examination style commonly found in Egyptian Ministry exams.
Overview
The model receives curriculum information (Unit, Topic, Grammar Focus, Target Skills, Life Skills, Core Values) together with a user request and generates Ministry-style English MCQs in structured JSON format.
The objective is to assess understanding rather than memorization, while preserving the writing style used in official examinations.
Base Model
- Model: Qwen/Qwen2.5-1.5B-Instruct
- Fine-tuning: LoRA
- Framework: LLaMA-Factory
- Training Type: Supervised Fine-Tuning (SFT)
- Deployment Model: Merged LoRA + Base Model
Dataset
The model was trained using two complementary datasets.
1. Official Egyptian Ministry Dataset
A manually collected dataset extracted from previous official English examinations.
Each sample was converted into an instruction-following format including:
- curriculum metadata
- grammar focus
- target skills
- ministry-style output
2. Synthetic Dataset
To improve generalization, an additional synthetic dataset was generated using GLM-5.2.
The synthetic data follows the same curriculum structure and examination philosophy while introducing diverse contexts and wording.
This significantly increased dataset diversity without changing the Ministry examination style.
Capabilities
The model can generate:
- Grammar Questions
- Vocabulary Questions
- Reading Questions
- Writing Questions
- Ministry-style Distractors
- JSON Responses
- Multiple Questions in a Single Request
Each generated question contains:
- statement
- correct_answer
- plausible_distractors
- explanation
Recommended Prompt Structure
Although the model understands simple prompts, it performs significantly better when curriculum information is supplied.
Recommended prompt:
- User request
- Unit information
- Topic
- Grammar Focus
- Target Skills
- Life Skills
- Core Values
- JSON Output Schema
Example Prompt
Generate 5 Ministry-style grammar MCQs.
Unit: 11
Topic: Literature
Grammar Focus: Comparative and Superlative Adjectives
Return JSON only.
Loading the Model
from transformers import AutoTokenizer, AutoModelForCausalLM
model_id = "tokhey/question-generator-model-qwen2.5-1.5b"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
device_map="auto",
torch_dtype="auto"
)
Example Inference
messages = [
{
"role":"user",
"content":"""
Generate 3 Ministry-style grammar MCQs.
Unit: 8
Topic:
A Journey Through Time
Grammar Focus:
Active and Passive Voice
Return JSON only.
"""
}
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=1024,
do_sample=False
)
print(
tokenizer.decode(
outputs[0][inputs.input_ids.shape[-1]:],
skip_special_tokens=True
)
)
Inference Tips
For deterministic evaluation:
do_sample=False
For more diverse generations:
do_sample=True
temperature=0.7
top_p=0.9
Intended Applications
- Educational Platforms
- AI Tutors
- Question Generation Systems
- Ministry-style Practice Exams
- Curriculum Assessment Systems
- Intelligent Learning Platforms
Limitations
- The model is optimized for Egyptian Ministry English examinations.
- Best performance is achieved when curriculum information is provided.
- Output quality depends on prompt specificity.
Acknowledgements
This model was developed as part of an undergraduate graduation project focused on automatic generation of Egyptian Ministry-style English examination questions using Large Language Models.
Base Model: Qwen Team
Fine-tuning Framework: LLaMA-Factory
Synthetic Data Generation: GLM-5.2
- Downloads last month
- 646