Downloads · 30 days
8
3% of all-time downloads
tokhey/egyptian-mcq-generator-mistral-7b
egyptian-mcq-generator-mistral-7b is a text generation model from tokhey. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
This repository contains a LoRA fine-tuned version of mistralai/Mistral-7B-Instruct-v0.3 for generating English multiple-choice questions that follow the official Egyptian Ministry of Education examination style.
Downloads · 30 days
8
3% of all-time downloads
All-time downloads
250
Public
Parameters
7.5B
4.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors4.1 GB · 100%
How the weights are stored.
U87.2B · 96%
From the Hugging Face model README
This repository contains a LoRA fine-tuned version of mistralai/Mistral-7B-Instruct-v0.3 for generating English multiple-choice questions that follow the official Egyptian Ministry of Education examination style.
| Parameter | Value |
|---|---|
| LoRA Rank | 16 |
| LoRA Alpha | 32 |
| Dropout | 0.05 |
| Learning Rate | 1e-4 |
| Epochs | 3 |
| Max Sequence Length | 2048 |
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
model_name = "tokhey/egyptian-mcq-generator-mistral-7b"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype=torch.float16,
device_map="auto",
)
messages = [
{
"role": "system",
"content": (
"You are a Senior English Assessment Specialist. "
"Generate official Egyptian Ministry of Education English MCQs. "
"Return valid JSON only."
),
},
{
"role": "user",
"content": (
"Generate 10 official Egyptian Ministry English MCQs "
"about Past Perfect / Past Perfect Continuous."
),
},
]
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=1500,
temperature=0.7,
)
print(
tokenizer.decode(
outputs[0][inputs.input_ids.shape[1]:],
skip_special_tokens=True,
)
)
{
"statement": "...",
"correct_answer": "...",
"plausible_distractors": [
"...",
"...",
"..."
],
"explanation": "..."
}
This model is derived from mistralai/Mistral-7B-Instruct-v0.3 and follows the original Mistral model license.