Downloads · 30 days
124
6% of all-time downloads
Madhour/gpt2-eli5
gpt2-eli5 is a text generation model from Madhour. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as gpl-3.0.
Given a few keywords, it generates an Eli5 question with a corresponding answer.
Downloads · 30 days
124
6% of all-time downloads
All-time downloads
2K
Public
Repo size
1.5 GB
Likes
0
Public
Click a slice to open those files.
.bin510 MB · 99%
From the Hugging Face model README
Given a few keywords, it generates an Eli5 question with a corresponding answer.
The model is mainly used for SeemsPhishy to auto generate newsletters for phishing/penetration-testing.
from transformers import pipeline, AutoTokenizer, AutoModelForCausalLM
from torch import tensor
tokenizer = AutoTokenizer.from_pretrained("Madhour/gpt2-eli5")
model = AutoModelForCausalLM.from_pretrained("Madhour/gpt2-eli5")
prompt = <|BOS|> +"I have a question."+ <|SEP|> + "keyword1,keyword2,keyword3" + <|SEP|>
prompt = tensor(tokenizer.encode(prompt)).unsqueeze(0)
text = model.generate(prompt,
do_sample=True,
min_length=50,
max_length=768,
top_k=30,
top_p=0.7,
temperature=0.9,
repetition_penalty=2.0,
num_return_sequences=3)