File size: 1,352 Bytes
a203f44 080d960 a203f44 080d960 7071962 be12ea4 26408d9 080d960 caf298b 4c9c00a ac39d3f a203f44 05775f7 f7321be 63ed614 f7321be |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
---
language: en
tags:
- ELI5
license: gpl-3.0
datasets:
- eli5
Task: Summarization
widget:
- text: "<|BOS|><|SEP|>Consulting,business,Fraud<|SEP|>"
inference:
parameters:
temperature: 0.9
return_full_text: False
repetition_penalty: 1
---
# Conditional ELI5 Generator
Given a few keywords, it generates an Eli5 question with a corresponding answer.
The model is mainly used for [SeemsPhishy](https://github.com/madhour/seemsphishy) to auto generate newsletters for phishing/penetration-testing.
# How to use
```Python
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)
``` |