Downloads · 30 days
6
0% of all-time downloads
KhantKyaw/T5-small_new_chatbot
T5-small_new_chatbot is a machine learning model from KhantKyaw. 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 apache-2.0.
Contributors: Team Machina: Khant Kyaw, Hein Min Htun, Htet Myat Noe Aung, Thant Zin Oo
Downloads · 30 days
6
0% of all-time downloads
All-time downloads
1.7K
Public
Parameters
60.5M
243 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors242 MB · 100%
From the Hugging Face model README
from transformers import T5Tokenizer, T5ForConditionalGeneration
model_name = "KhantKyaw/T5-small_new_chatbot"
tokenizer = T5Tokenizer.from_pretrained(model_name)
model = T5ForConditionalGeneration.from_pretrained(model_name)
def generate_response(input_text):
input_ids = tokenizer.encode(input_text, return_tensors='pt')
outputs = model.generate(input_ids,
min_length=5,
max_length=300,
do_sample=True, num_beams=5, no_repeat_ngram_size=2)
generated_text = tokenizer.decode(
outputs[0], skip_special_tokens=True)
return generated_text
generate_response("how to be healthy?")
Contributors: Team Machina: Khant Kyaw, Hein Min Htun, Htet Myat Noe Aung, Thant Zin Oo