Downloads · 30 days
365
8% of all-time downloads
r1char9/T5_chat
T5_chat is a text generation model from r1char9. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
A fine-tuned version of ai-forever/ruT5-base for open-domain text generation / conversational response generation in Russian.
Downloads · 30 days
365
8% of all-time downloads
All-time downloads
4.3K
Public
Parameters
223M
893 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors892 MB · 100%
From the Hugging Face model README
A fine-tuned version of ai-forever/ruT5-base
for open-domain text generation / conversational response generation in
Russian.
The model takes a text prompt (e.g. a question or a conversational turn) and generates a free-form text continuation or reply.
from transformers import AutoTokenizer, T5ForConditionalGeneration
chat_checkpoint = "r1char9/T5_chat"
chat_model = T5ForConditionalGeneration.from_pretrained(chat_checkpoint)
chat_tokenizer = AutoTokenizer.from_pretrained(chat_checkpoint)
def chat_fun(text: str):
tokenized_sentence = chat_tokenizer(text, return_tensors="pt", truncation=True)
output = chat_model.generate(**tokenized_sentence, num_beams=2, max_length=100)
return chat_tokenizer.decode(output[0], skip_special_tokens=True)
text = "Что самое главное в человеке ?"
response = chat_fun(text)
print(response)
# Самое главное в человеке - это его любовь и уважение к другим людям.
# Это означает, что он должен быть искренним и искренним в своих мыслях и чувствах,
# а также готов жертвовать своим личным и профессиональным идеалами и ценностям, чтобы достичь своих целей.