Downloads · 30 days
21
27% of all-time downloads
tum-nlp/neural-news-generator-llama-2-7b-chat-en
neural-news-generator-llama-2-7b-chat-en is a text generation model from tum-nlp. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as llama2.
Base Model: https://huggingface.co/meta-llama/Llama-2-7b-chat-hf
Downloads · 30 days
21
27% of all-time downloads
All-time downloads
77
Public
Parameters
6.7B
13.5 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors13.5 GB · 100%
From the Hugging Face model README
Base Model: https://huggingface.co/meta-llama/Llama-2-7b-chat-hf
Model fine-tuned on a real news dataset and optimized for neural news generation.
from transformers import AutoModelForSequenceClassification, AutoTokenizer, pipeline
# Load model and tokenizer
tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-2-7b-chat-hf")
model = AutoModelForSequenceClassification.from_pretrained('tum-nlp/neural-news-generator-llama-2-7b-chat-en')
# Create the pipeline for neural news generation and set the repetition penalty >1.1 to punish repetition.
generator = pipeline('text-generation',
model=model,
tokenizer=tokenizer,
repetition_penalty=1.2)
# Define the prompt
prompt = "Headline: UK headline inflation rate drops sharply to 6.8% in July, in line with expectations Article: LONDON U.K. headline inflation cooled sharply in July to [EOP]"
# Generate
generator(prompt, max_length=1000, num_return_sequences=1)
Trained on 6k datapoints (including all splits) from: https://paperswithcode.com/dataset/cc-news