SinLlama-MCQ
SinLlama-MCQ is a specialized fine-tuned version of Llama-3-8B designed to generate Multiple Choice Questions (MCQs) in Sinhala. This model was developed to assist educators and students in Sri Lanka by automating the creation of high-quality assessment materials.
Model Details
- Developed by: Joseph Rodrigo
- Model Type: PeftAdapter (LoRA)
- Base Model: meta-llama/Meta-Llama-3-8B
- Language(s): Sinhala (Primary), English
- Task: Causal Language Modeling / MCQ Generation
Technical Specifications
LoRA Hyperparameters
The model was trained using the following configuration:
- Rank (r): 64
- Alpha (lora_alpha): 128.0
- Dropout (lora_dropout): 0.05
- Target Modules:
q_proj,k_proj,v_proj,o_proj,gate_proj,up_proj,down_proj - Modules to Save:
embed_tokens,lm_head(to ensure Sinhala script compatibility)
Framework Versions
- PEFT: 0.18.1
- Transformers: Latest compatible with Llama-3
Intended Use
Direct Use
This model is intended for:
- Generating 4-option MCQs from Sinhala text paragraphs.
- Creating educational content for Sri Lankan schools and private tutors.
Out-of-Scope Use
- General-purpose chat not related to educational assessments.
- Critical medical or legal advice without human review.
How to Load (FastAPI / Python)
To use this model in your backend, ensure you have the peft and transformers libraries installed.
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
base_model_path = "meta-llama/Meta-Llama-3-8B"
adapter_path = "YOUR_HF_USERNAME/sinllama-mcq"
tokenizer = AutoTokenizer.from_pretrained(base_model_path)
model = AutoModelForCausalLM.from_pretrained(
base_model_path,
torch_dtype=torch.float16,
device_map="auto"
)
model = PeftModel.from_pretrained(model, adapter_path)
def generate_mcq(prompt):
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
with torch.no_grad():
outputs = model.generate(**inputs, max_new_tokens=512)
return tokenizer.decode(outputs[0], skip_special_tokens=True)
- Downloads last month
- 9
Model tree for itsjorigo/sinllama-mcq
Base model
meta-llama/Meta-Llama-3-8B