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('Евгений Онегин интересная книга')
- Downloads last month
- 3
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social
visibility and check back later, or deploy to Inference Endpoints (dedicated)
instead.