Text Generation
Transformers
Safetensors
llama
education
south-africa
caps-curriculum
text-generation-inference
Instructions to use misterseitz/mzansilm-tutor with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use misterseitz/mzansilm-tutor with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="misterseitz/mzansilm-tutor")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("misterseitz/mzansilm-tutor") model = AutoModelForCausalLM.from_pretrained("misterseitz/mzansilm-tutor", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use misterseitz/mzansilm-tutor with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "misterseitz/mzansilm-tutor" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "misterseitz/mzansilm-tutor", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/misterseitz/mzansilm-tutor
- SGLang
How to use misterseitz/mzansilm-tutor 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 "misterseitz/mzansilm-tutor" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "misterseitz/mzansilm-tutor", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "misterseitz/mzansilm-tutor" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "misterseitz/mzansilm-tutor", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use misterseitz/mzansilm-tutor with Docker Model Runner:
docker model run hf.co/misterseitz/mzansilm-tutor
MzansiLM-Tutor
MzansiLM-Tutor is a specialized instruction-tuned version of anrilombard/mzansilm-125m, specifically designed to act as an AI Tutor for the South African CAPS (Curriculum and Assessment Policy Statement) curriculum.
Model Details
- Model Name: MzansiLM-Tutor
- Base Model:
anrilombard/mzansilm-125m - Architecture: Llama-based architecture (125M parameters)
- Languages: English, Afrikaans, isiZulu, isiXhosa, Sesotho, Sepedi, Setswana, Xitsonga, Siswati, isiNdebele, Tshivenda
- License: MIT
Intended Uses & Limitations
Intended Uses
This model is intended to be used as an educational assistant and tutor. It excels at:
- Explaining core concepts from the South African curriculum (Grade 1-12).
- Generating multiple-choice questions (MCQs), flashcards, and interactive lesson templates.
- Assisting students in their mother tongue across all 11 official South African languages.
- Summarizing textbook materials into structured study formats.
Limitations & Ethical Considerations
- Size Constraints: As a 125M parameter model, it may hallucinate or struggle with highly complex reasoning tasks compared to larger frontier models (like GPT-4 or Claude).
- Curriculum Scope: Its knowledge is heavily anchored in the CAPS curriculum. It may not perform optimally outside of these specific educational boundaries.
- Language Nuance: While trained on all 11 official languages, proficiency may vary depending on the specific language's representation in the training dataset.
Training Details
Dataset
The model was fine-tuned on a proprietary dataset containing 268,794 instruction-tuning examples. This dataset was built by aggregating:
- DBE (Department of Basic Education) National Catalogues and Workbooks.
- Translated curriculum topics, descriptions, and learning objectives across 11 languages.
- Thousands of AI-generated question templates, flashcards, and lesson summaries.
Training Procedure
- Hardware: Fine-tuned on RunPod GPUs.
- Method: Parameter-Efficient Fine-Tuning (PEFT) using LoRA (Low-Rank Adaptation) and then merged back into the base weights.
- Steps: 500 steps
- Final Training Loss:
2.101 - Precision:
float16
Usage Example
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "misterseitz/mzansilm-tutor"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.float16,
low_cpu_mem_usage=True
)
prompt = "SYSTEM: You are a Grade 10 Physical Sciences tutor.\nSTUDENT: Explain Newton's First Law of Motion.\nTUTOR:"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=200, temperature=0.7)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Acknowledgments
- Base Model: We acknowledge Anri Lombard for the creation of the foundational MzansiLM model.
- Curriculum Data: The Department of Basic Education (DBE) for their open-access National Catalogues.
- Downloads last month
- 228
Model tree for misterseitz/mzansilm-tutor
Base model
uctnlp/mzansilm-125m