Downloads · 30 days
9
32% of all-time downloads
zhaochaofeng/chat-t5
chat-t5 is a machine learning model from zhaochaofeng. 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.
Downloads · 30 days
9
32% of all-time downloads
All-time downloads
28
Public
Parameters
188M
753 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors751 MB · 100%
From the Hugging Face model README
from transformers import AutoTokenizer
from transformers import AutoModelForSeq2SeqLM
model = 'zhaochaofeng/chat-t5'
tokenizer = AutoTokenizer.from_pretrained(model)
model = AutoModelForSeq2SeqLM.from_pretrained(model)
txt = '请介绍一下什么是机器学习'
inputs = tokenizer(text=txt, return_tensors='pt')
outputs = model.generate(inputs=inputs.input_ids, max_new_tokens=300, do_sample=True)
res = tokenizer.batch_decode(sequences=outputs, skip_special_tokens=True)
print(res)