Downloads · 30 days
19
3% of all-time downloads
svjack/summary-dialogue-eng
summary-dialogue-eng is a text generation model from svjack. Use it when you need the model to write or continue text. It is set up for transformers.
Downloads · 30 days
19
3% of all-time downloads
All-time downloads
684
Public
Repo size
2 GB
Likes
0
Public
Click a slice to open those files.
.bin990 MB · 100%
From the Hugging Face model README
from transformers import T5ForConditionalGeneration
from transformers import T5TokenizerFast as T5Tokenizer
model = "svjack/summary-dialogue-eng"
device = "cpu"
tokenizer = T5Tokenizer.from_pretrained(model)
model = T5ForConditionalGeneration.from_pretrained(model).to(device).eval()
prompt = "The Wisconsin Territorial Centennial half dollar was designed by David Parsons and Benjamin Hawkins and minted by the United States Bureau of the Mint in 1936. The obverse (pictured) depicts a pick axe and lead ore, referring to the lead mining in early Wisconsin"
prompt = "{}\nCandidates:Tom Jack".format(prompt)
encode = tokenizer(prompt, return_tensors='pt').to(device)
answer = model.generate(encode.input_ids,
max_length = 128,
num_beams=2,
top_p = 0.95,
top_k = 50,
repetition_penalty = 2.5,
length_penalty=1.0,
early_stopping=True,
)[0]
decoded = tokenizer.decode(answer, skip_special_tokens=True)
decoded.replace("Tom:", "\n").replace("Jack:", "\n").split("\n")
</br>
['',
' Have you seen the Wisconsin Territorial Centennial half dollar? ',
' Yeah, it was designed by David Parsons and Benjamin Hawkins. ',
' What is it? ',
" It's a half dollar with a pick axe and lead ore. ",
" That's great!"]