Views
No views yet
| Category | Latin Input | Model Output |
|---|---|---|
| Formal Grammar | Raeesul jumhooriyya... thasdheegu kuravvaifi | ރައީސުލް ޖުމްހޫރިއްޔާ... ތަސްދީގުކުރައްވައިފި |
| Casual / Chat | Aharen miadhu varah ban'du hai | އަހަރެން މިއަދު ވަރަށް ބަނޑުހައި |
| Official Titles | Minister of Foreign Affairs Moosa Zameer | މިނިސްޓަރު އޮފް ފޮރިން އެފެއާސް މޫސަ ޒަމީރު |
| News Phrasing | Police service in vanee ekan kuhveri kohfa | ޕޮލިސް ސާވިސްއިން ވަނީ އެކަން ކުށްވެރިކޮށްފައި |
1from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
2
3tokenizer = AutoTokenizer.from_pretrained("Neobe/dhivehi-byt5-latin2thaana-v1")
4model = AutoModelForSeq2SeqLM.from_pretrained("Neobe/dhivehi-byt5-latin2thaana-v1")
5
6text = "Raeesul jumhooriyya miadhu ganoonu thasdheegu kuravvaifi"
7inputs = tokenizer(text, return_tensors="pt")
8
9outputs = model.generate(**inputs, max_length=256)
10
11print(tokenizer.decode(outputs[0], skip_special_tokens=True))
12# Output: ރައީސުލް ޖުމްހޫރިއްޔާ މިއަދު ގާނޫނު ތަސްދީގުކުރައްވައިފި