CALI Family
Collection
2 items • Updated
How to use Sandroeth/cali-id-en-translate with Transformers:
# Use a pipeline as a high-level helper
# Warning: Pipeline type "translation" is no longer supported in transformers v5.
# You must load the model directly (see below) or downgrade to v4.x with:
# 'pip install "transformers<5.0.0'
from transformers import pipeline
pipe = pipeline("translation", model="Sandroeth/cali-id-en-translate", trust_remote_code=True) # Load model directly
from transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("Sandroeth/cali-id-en-translate", trust_remote_code=True, device_map="auto")A lightweight 121M-parameter translation model fine-tuned from Sandroeth/cali-0.1B for bilingual translation between Indonesian and English.
The model performs well on everyday sentences, casual conversations, and general-purpose translation between Indonesian and English. Its small size makes it suitable for applications that require low latency and lightweight deployment.
However, there are some limitations:
The model was fine-tuned using a fixed prompt template. For the best results, use the following formats.
Indonesian → English:
[id→en]
{input text}
→
English → Indonesian:
[en→id]
{input text}
→
Inference example:
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch, re
model_id = "Sandroeth/cali-id-en-translate"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_id,
trust_remote_code=True,
device_map="auto"
)
model.eval()
def translate(text, locale):
direction = "[id→en]" if locale == "id" else "[en→id]"
prompt = f"{direction}\n{text}\n→"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
out = model.generate(
**inputs,
max_new_tokens=64,
do_sample=False,
repetition_penalty=1.5,
no_repeat_ngram_size=3,
pad_token_id=tokenizer.eos_token_id,
use_cache=False,
)
gen = out[0][inputs["input_ids"].shape[1]:]
result = tokenizer.decode(gen, skip_special_tokens=True).strip()
return re.split(r'(?<=[.!?])\s+', result)[0]
print(translate("Dia pergi ke pasar setiap pagi.", "id"))
print(translate("The weather is very cold today.", "en"))
| Input | Direction | Output |
|---|---|---|
| Saya makan nasi. | id→en | I eat rice. |
| Dia pergi ke pasar setiap pagi. | id→en | He goes to the market every morning. |
| She is happy. | en→id | Dia bahagia. |
| The weather is very cold today. | en→id | Cuacanya sangat dingin hari ini. |
| Pemerintah sedang membangun infrastruktur baru. | id→en | The government is building new infrastructure. |
If you use or reference this model in your research or projects, please cite:
@article{cali2026,
title = {CALI 0.1B},
author = {Sandroeth},
year = {2026},
publisher = {Hugging Face},
url = {https://huggingface.co/Sandroeth/cali-0.1B}
}
Sandroeth
Apache License 2.0
Base model
Sandroeth/cali-0.1B