danyaljj commited on
Commit
c2612f6
1 Parent(s): 777ef85

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +12 -0
README.md ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Sample usage:
2
+ ```python
3
+ tokenizer = GPT2Tokenizer.from_pretrained("gpt2")
4
+ model = GPT2LMHeadModel.from_pretrained("danyaljj/gpt2_question_generation_given_paragraph_answer")
5
+ input_ids = tokenizer.encode("There are two apples on the counter. A: apples Q:", return_tensors="pt")
6
+ outputs = model.generate(input_ids)
7
+ print("Generated:", tokenizer.decode(outputs[0], skip_special_tokens=True))
8
+ ```
9
+ Which should produce this:
10
+ ```
11
+ Generated: There are two apples on the counter. A: apples Q: What is the name of the counter
12
+ ```