cmykk commited on
Commit
4be6ee3
·
verified ·
1 Parent(s): aa0cf68

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +34 -3
README.md CHANGED
@@ -1,3 +1,34 @@
1
- ---
2
- license: llama2
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: llama2
3
+ language:
4
+ - en
5
+ ---
6
+ Base Model:
7
+ https://huggingface.co/meta-llama/Llama-2-7b-chat-hf
8
+
9
+ ---
10
+ Model fine-tuned on a real news dataset and optimized for neural news generation.
11
+
12
+ ```python
13
+ from transformers import AutoModelForSequenceClassification, AutoTokenizer, pipeline
14
+
15
+ # Load model and tokenizer
16
+ tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-2-7b-chat-hf")
17
+ model = AutoModelForSequenceClassification.from_pretrained('tum-nlp/neural-news-generator-llama-2-7b-chat-en')
18
+
19
+ # Create the pipeline for neural news generation and set the repetition penalty >1.1 to punish repetition.
20
+ generator = pipeline('text-generation',
21
+ model=model,
22
+ tokenizer=tokenizer,
23
+ repetition_penalty=1.2)
24
+
25
+ # Define the prompt
26
+ 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]"
27
+
28
+ # Generate
29
+ generator(prompt, max_length=1000, num_return_sequences=1)
30
+
31
+ ```
32
+
33
+ Trained on 6k datapoints (including all splits) from:
34
+ https://paperswithcode.com/dataset/cc-news