nfL6/yahoo_answers_qa
Updated • 369 • 27
How to use jojo-ai-mst/Y5Bot with Transformers:
# Load model directly
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("jojo-ai-mst/Y5Bot")
model = AutoModelForSeq2SeqLM.from_pretrained("jojo-ai-mst/Y5Bot")Y5 Bot is a text2text transfer transformer model working in English Language.
It is lightweight, fast, and easy to use for text generation.
Y5 Bot can answer and generate text short to the main points.
pip install transformers
from transformers import pipeline
generator = pipeline(model="jojo-ai-mst/Y5Bot")
generator("What is Artificial Intelligence?")
model = T5ForConditionalGeneration.from_pretrained("jojo-ai-mst/Y5Bot")
tokenizer = T5Tokenizer.from_pretrained("jojo-ai-mst/Y5Bot")
my_question = "What do you think about the benefit of Artificial Intelligence?"
inputs = "Please answer to this question: " + my_question
inputs = tokenizer(inputs, return_tensors="pt")
outputs = model.generate(**inputs)
answer = tokenizer.decode(outputs[0])
print(answer)