Downloads · 30 days
278
2% of all-time downloads
cointegrated/rut5-small-chitchat
rut5-small-chitchat is a machine learning model from cointegrated. 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. The card lists the license as mit.
This is a version of the cointegrated/rut5-small model fine-tuned on some Russian dialogue data. It is not very smart and creative, but it is small and fast, and can serve as a fallback response generator for some cha…
Downloads · 30 days
278
2% of all-time downloads
All-time downloads
11.2K
Public
Parameters
64.6M
518 MB on disk
Likes
5
Public
Click a slice to open those files.
.bin259 MB · 50%
From the Hugging Face model README
This is a version of the cointegrated/rut5-small model fine-tuned on some Russian dialogue data. It is not very smart and creative, but it is small and fast, and can serve as a fallback response generator for some chatbot or can be fine-tuned to imitate the style of someone.
The input of the model is the previous dialogue utterances separated by '\n\n', and the output is the next utterance.
The model can be used as follows:
# !pip install transformers sentencepiece
import torch
from transformers import T5ForConditionalGeneration, T5Tokenizer
tokenizer = T5Tokenizer.from_pretrained("cointegrated/rut5-small-chitchat")
model = T5ForConditionalGeneration.from_pretrained("cointegrated/rut5-small-chitchat")
text = 'Привет! Расскажи, как твои дела?'
inputs = tokenizer(text, return_tensors='pt')
with torch.no_grad():
hypotheses = model.generate(
**inputs,
do_sample=True, top_p=0.5, num_return_sequences=3,
repetition_penalty=2.5,
max_length=32,
)
for h in hypotheses:
print(tokenizer.decode(h, skip_special_tokens=True))
# Как обычно.
# Сейчас - в порядке.
# Хорошо.
# Wall time: 363 ms