Instructions to use itsjorigo/sinllama-mcq with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use itsjorigo/sinllama-mcq with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("meta-llama/Meta-Llama-3-8B") model = PeftModel.from_pretrained(base_model, "itsjorigo/sinllama-mcq") - Transformers
How to use itsjorigo/sinllama-mcq with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="itsjorigo/sinllama-mcq")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("itsjorigo/sinllama-mcq", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use itsjorigo/sinllama-mcq with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "itsjorigo/sinllama-mcq" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "itsjorigo/sinllama-mcq", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/itsjorigo/sinllama-mcq
- SGLang
How to use itsjorigo/sinllama-mcq 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 "itsjorigo/sinllama-mcq" \ --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": "itsjorigo/sinllama-mcq", "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 "itsjorigo/sinllama-mcq" \ --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": "itsjorigo/sinllama-mcq", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Unsloth Studio
How to use itsjorigo/sinllama-mcq with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for itsjorigo/sinllama-mcq to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for itsjorigo/sinllama-mcq to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for itsjorigo/sinllama-mcq to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="itsjorigo/sinllama-mcq", max_seq_length=2048, ) - Docker Model Runner
How to use itsjorigo/sinllama-mcq with Docker Model Runner:
docker model run hf.co/itsjorigo/sinllama-mcq
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
- 1
Model tree for itsjorigo/sinllama-mcq
Base model
meta-llama/Meta-Llama-3-8B