KeriYuu commited on
Commit
bbb31ba
1 Parent(s): b4f8f1c

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +11 -0
README.md ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## Usage
2
+ ```python
3
+ from transformers import T5Tokenizer, AutoModelForSeq2SeqLM
4
+ tokenizer = T5Tokenizer.from_pretrained("t5-base")
5
+ model = AutoModelForSeq2SeqLM.from_pretrained("KeriYuu/bootstrapQA")
6
+ input_text1 = "D2QA: Apple orchards lack the requisite soil pH to make blue colors."
7
+ input_text2 = "QA2D: question: Is the chance of always winning a lotto consistently very low? answer: Yes."
8
+ input = tokenizer(input_text1, return_tensors='pt', padding=True, max_length=64, truncation=True)
9
+ output = model.generate(input_ids=input['input_ids'],attention_mask=input['attention_mask'],max_length=64,num_beams=5)
10
+ result = tokenizer.batch_decode(output, skip_special_tokens=True)
11
+ ```