Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,34 @@
|
|
1 |
-
---
|
2 |
-
license: bigscience-bloom-rail-1.0
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: bigscience-bloom-rail-1.0
|
3 |
+
language:
|
4 |
+
- en
|
5 |
+
---
|
6 |
+
Base Model:
|
7 |
+
https://huggingface.co/bigscience/bloomz-7b1
|
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('bigscience/bloomz')
|
17 |
+
model = AutoModelForSequenceClassification.from_pretrained('tum-nlp/neural-news-generator-bloomz-7b1-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
|