Downloads · 30 days
17
3% of all-time downloads
SaranaAbidueva/mbart50_ru_bua
mbart50_ru_bua is a machine learning model from SaranaAbidueva. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers.
This model translates from Russian to Buryat language.
Downloads · 30 days
17
3% of all-time downloads
All-time downloads
487
Public
Repo size
5.1 GB
Likes
1
Public
Click a slice to open those files.
.bin2.5 GB · 100%
From the Hugging Face model README
This model translates from Russian to Buryat language.
How to use in Python:
from transformers import MBartForConditionalGeneration, MBart50Tokenizer
model = MBartForConditionalGeneration.from_pretrained("SaranaAbidueva/mbart50_ru_bua")
tokenizer = MBart50Tokenizer.from_pretrained("SaranaAbidueva/mbart50_ru_bua")
def translate(text, max_length=200, num_beams=5, repetition_penalty=5.0, **kwargs):
encoded = tokenizer(text, return_tensors="pt")
generated_tokens = model.generate(
**encoded.to(model.device),
max_length=max_length,
num_beams=num_beams,
repetition_penalty=repetition_penalty
)
return tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)[0]
translate('Евгений Онегин интересная книга')