Downloads · 30 days
21
3% of all-time downloads
bonur/t5-base-tr
t5-base-tr is a machine learning model from bonur. 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.
Please check google/mt5-base model. This model is pruned version of mt5-base model to only work in Turkish and English. Also for methodology, you can check Russian version of mT5-base cointegrated/rut5-base.
Downloads · 30 days
21
3% of all-time downloads
All-time downloads
685
Public
Parameters
229M
1.8 GB on disk
Likes
2
Public
Click a slice to open those files.
.bin916 MB · 50%
From the Hugging Face model README
Please check google/mt5-base model. This model is pruned version of mt5-base model to only work in Turkish and English. Also for methodology, you can check Russian version of mT5-base cointegrated/rut5-base.
You should import required libraries by:
from transformers import T5ForConditionalGeneration, T5Tokenizer
import torch
To load model:
model = T5ForConditionalGeneration.from_pretrained('bonur/t5-base-tr')
tokenizer = T5Tokenizer.from_pretrained('bonur/t5-base-tr')
To make inference with given text, you can use the following code:
inputs = tokenizer("Bu hafta hasta olduğum için <extra_id_0> gittim.", return_tensors='pt')
with torch.no_grad():
hypotheses = model.generate(
**inputs,
do_sample=True, top_p=0.95,
num_return_sequences=2,
repetition_penalty=2.75,
max_length=32,
)
for h in hypotheses:
print(tokenizer1.decode(h))
You can tune parameters for better result, and this model is ready to fine-tune in bilingual downstream tasks with English and Turkish.