small-100-Singlish-Sinhala-CodeMix

137
license:mit
by
savinugunarathna
Language Model
OTHER
New
137 downloads
Early-stage
Edge AI:
Mobile
Laptop
Server
Unknown
Mobile
Laptop
Server
Quick Summary

AI model with specialized capabilities.

Code Examples

Usagepythontransformers
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM

model_id  = "savinugunarathna/small-100-Singlish-Sinhala-CodeMix"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model     = AutoModelForSeq2SeqLM.from_pretrained(model_id)

tokenizer.src_lang = "en"
tgt_lang_id = tokenizer.lang_code_to_id["si"]

def translate(text):
    inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=256)
    output = model.generate(
        **inputs,
        forced_bos_token_id=tgt_lang_id,
        num_beams=3,
        max_new_tokens=128,
        repetition_penalty=1.2,
    )
    decoded = tokenizer.decode(output[0], skip_special_tokens=True).strip()
    if decoded.startswith("__si__"):
        decoded = decoded[len("__si__"):].strip()
    return decoded

print(translate("mama hungry, kanna yamu"))
# → මම බඩගිනි, කන්න යමු

Deploy This Model

Production-ready deployment in minutes

Together.ai

Instant API access to this model

Fastest API

Production-ready inference API. Start free, scale to millions.

Try Free API

Replicate

One-click model deployment

Easiest Setup

Run models in the cloud with simple API. No DevOps required.

Deploy Now

Disclosure: We may earn a commission from these partners. This helps keep LLMYourWay free.