Downloads · 30 days
16
3% of all-time downloads
KeriYuu/t5-base-qa2d-d2qa
t5-base-qa2d-d2qa is a machine learning model from KeriYuu. 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 afl-3.0.
Add the prefix "D2QA:" to the declaration.
Downloads · 30 days
16
3% of all-time downloads
All-time downloads
474
Public
Repo size
1.8 GB
Likes
1
Public
Click a slice to open those files.
.bin892 MB · 100%
From the Hugging Face model README
Add the prefix "D2QA:" to the declaration.
Add the prefix "QA2D:" to the QA pair.
from transformers import T5Tokenizer, AutoModelForSeq2SeqLM
tokenizer = T5Tokenizer.from_pretrained("t5-base")
model = AutoModelForSeq2SeqLM.from_pretrained("KeriYuu/bootstrapQA")
input_text1 = "D2QA: Apple orchards lack the requisite soil pH to make blue colors."
input_text2 = "QA2D: question: Is the chance of always winning a lotto consistently very low? answer: Yes."
input = tokenizer(input_text1, return_tensors='pt', padding=True, max_length=64, truncation=True)
output = model.generate(input_ids=input['input_ids'],attention_mask=input['attention_mask'],max_length=64,num_beams=5)
result = tokenizer.batch_decode(output, skip_special_tokens=True)