Instructions to use ai-for-good-lab/byol-mri-12b-merged with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ai-for-good-lab/byol-mri-12b-merged with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ai-for-good-lab/byol-mri-12b-merged") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("ai-for-good-lab/byol-mri-12b-merged") model = AutoModelForImageTextToText.from_pretrained("ai-for-good-lab/byol-mri-12b-merged") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use ai-for-good-lab/byol-mri-12b-merged with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ai-for-good-lab/byol-mri-12b-merged" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ai-for-good-lab/byol-mri-12b-merged", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ai-for-good-lab/byol-mri-12b-merged
- SGLang
How to use ai-for-good-lab/byol-mri-12b-merged 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 "ai-for-good-lab/byol-mri-12b-merged" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ai-for-good-lab/byol-mri-12b-merged", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "ai-for-good-lab/byol-mri-12b-merged" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ai-for-good-lab/byol-mri-12b-merged", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ai-for-good-lab/byol-mri-12b-merged with Docker Model Runner:
docker model run hf.co/ai-for-good-lab/byol-mri-12b-merged
BYOL Māori 12B
This model was produced by the BYOL framework for extending LLMs to low-resource languages.
- Base model: google/gemma-3-12b-pt
- Language: Māori (mri)
- Training stage: Merged (CPT + IT via model merging)
- License: Gemma Terms of Use (derived from Gemma 3)
- Paper: BYOL: Bring Your Own Language Into LLMs
- Code: github.com/microsoft/byol
Model Description
This is a merged language model for Māori (mri) that combines the language knowledge acquired during continual pre-training with the instruction-following capabilities from supervised fine-tuning. It was produced by merging BYOL Māori 12b CPT and BYOL Māori 12b IT checkpoints back into the original Gemma 3 instruction model, using the BYOL framework.
This is the recommended model for most users. It supports chat/instruction-following and has the strongest overall performance on Māori benchmarks (see the paper for evaluation results).
Usage
pip install -U transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "ai-for-good-lab/byol-mri-12b-merged"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto", dtype=torch.bfloat16)
# Chat inference
messages = [{"role": "user", "content": "Kōrerotia mai mō Aotearoa."}]
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True, return_dict=True).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Citation
@article{zamir2026byolbringlanguagellms,
title={BYOL: Bring Your Own Language Into LLMs},
author={Syed Waqas Zamir and Wassim Hamidouche and Boulbaba Ben Amor and Luana Marotti and Inbal Becker-Reshef and Juan Lavista Ferres},
year={2026},
journal={arXiv:2601.10804},
url={https://arxiv.org/abs/2601.10804},
}
- Downloads last month
- 10
Model tree for ai-for-good-lab/byol-mri-12b-merged
Base model
google/gemma-3-12b-pt