Downloads · 30 days
5
2% of all-time downloads
tokhey/egyptian-mcq-generator-gemma-7b
egyptian-mcq-generator-gemma-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 gemma.
This repository contains a LoRA fine-tuned version of google/gemma-7b-it for generating English multiple-choice questions that follow the official Egyptian Ministry of Education examination style.
Downloads · 30 days
5
2% of all-time downloads
All-time downloads
276
Public
Parameters
8.8B
5.6 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors5.6 GB · 99%
How the weights are stored.
U88B · 91%
From the Hugging Face model README
This repository contains a LoRA fine-tuned version of google/gemma-7b-it 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-gemma-7b"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype=torch.float16,
device_map="auto",
)
messages = [
{
"role": "user",
"content": "Generate 10 official Egyptian Ministry English MCQs about Past Perfect. Return only valid JSON."
}
]
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 google/gemma-7b-it and follows the Gemma license.