danyaljj commited on
Commit
df96472
1 Parent(s): b4cd0c6

Create README.md

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