Downloads · 30 days
383
0% of all-time downloads
t-bank-ai/ruDialoGPT-medium
ruDialoGPT-medium is a machine learning model from t-bank-ai. 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 generation model is based on sberbank-ai/rugpt3mediumbasedongpt2. It's trained on large corpus of dialog data and can be used for buildning generative conversational agents
Downloads · 30 days
383
0% of all-time downloads
All-time downloads
110K
Public
Repo size
3 GB
Likes
36
Public
Click a slice to open those files.
.bin1.5 GB · 100%
From the Hugging Face model README
This generation model is based on sberbank-ai/rugpt3medium_based_on_gpt2. It's trained on large corpus of dialog data and can be used for buildning generative conversational agents
The model was trained with context size 3
On a private validation set we calculated metrics introduced in this paper:
| sensibleness | specificity | SSA | |
|---|---|---|---|
| tinkoff-ai/ruDialoGPT-small | 0.64 | 0.5 | 0.57 |
| tinkoff-ai/ruDialoGPT-medium | 0.78 | 0.69 | 0.735 |
How to use:
import torch
from transformers import AutoTokenizer, AutoModelWithLMHead
tokenizer = AutoTokenizer.from_pretrained('tinkoff-ai/ruDialoGPT-medium')
model = AutoModelWithLMHead.from_pretrained('tinkoff-ai/ruDialoGPT-medium')
inputs = tokenizer('@@ПЕРВЫЙ@@ привет @@ВТОРОЙ@@ привет @@ПЕРВЫЙ@@ как дела? @@ВТОРОЙ@@', return_tensors='pt')
generated_token_ids = model.generate(
**inputs,
top_k=10,
top_p=0.95,
num_beams=3,
num_return_sequences=3,
do_sample=True,
no_repeat_ngram_size=2,
temperature=1.2,
repetition_penalty=1.2,
length_penalty=1.0,
eos_token_id=50257,
max_new_tokens=40
)
context_with_response = [tokenizer.decode(sample_token_ids) for sample_token_ids in generated_token_ids]
context_with_response