Downloads · 30 days
10
2% of all-time downloads
utkan/gpt2-news-headlines-v1
gpt2-news-headlines-v1 is a text generation model from utkan. Use it when you need the model to write or continue text. It is set up for transformers.
NEWS: Health experts said it is too early to predict whether demand would match up with the 171 million doses of the new boosters the U.S. ordered for the fall.\n\n HEADLINE:
Downloads · 30 days
10
2% of all-time downloads
All-time downloads
459
Public
Repo size
1 GB
Likes
0
Public
Click a slice to open those files.
.bin510 MB · 99%
From the Hugging Face model README
NEWS: Health experts said it is too early to predict whether demand would match up with the 171 million doses of the new boosters the U.S. ordered for the fall.\n\n HEADLINE:
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("utkan/gpt2-news-headlines-v1")
model = AutoModelForCausalLM.from_pretrained("utkan/gpt2-news-headlines-v1")
device = "cuda" # or "cpu"
input_text = "NEWS: Health experts said it is too early to predict whether demand would match up with the 171 million doses of the new boosters the U.S. ordered for the fall.\n\n HEADLINE:"
x = tokenizer([input_text], return_tensors='pt').input_ids.to(device)
y = model.generate(x, max_new_tokens=1)
tokenizer.batch_decode(y, skip_special_tokens=True)[0].split("HEADLINE: ")[-1]