Downloads · 30 days
20
1% of all-time downloads
danyaljj/gpt2_question_generation_given_paragraph_answer
gpt2_question_generation_given_paragraph_answer is a text generation model from danyaljj. Use it when you need the model to write or continue text. It is set up for transformers.
Downloads · 30 days
20
1% of all-time downloads
All-time downloads
2K
Public
Repo size
1.1 GB
Likes
1
Public
Click a slice to open those files.
.bin548 MB · 100%
From the Hugging Face model README
Sample usage:
tokenizer = GPT2Tokenizer.from_pretrained("gpt2")
model = GPT2LMHeadModel.from_pretrained("danyaljj/gpt2_question_generation_given_paragraph_answer")
input_ids = tokenizer.encode("There are two apples on the counter. A: apples Q:", return_tensors="pt")
outputs = model.generate(input_ids)
print("Generated:", tokenizer.decode(outputs[0], skip_special_tokens=True))
Which should produce this:
Generated: There are two apples on the counter. A: apples Q: What is the name of the counter