Commit
·
467ae22
1
Parent(s):
0581fd9
Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,5 @@
|
|
|
|
|
|
1 |
from transformers import BartTokenizer, BartForConditionalGeneration, BartConfig
|
2 |
|
3 |
model = BartForConditionalGeneration.from_pretrained('facebook/bart-large-cnn')
|
@@ -8,4 +10,5 @@ inputs = tokenizer([ARTICLE_TO_SUMMARIZE], max_length=1024, return_tensors='pt')
|
|
8 |
|
9 |
# Generate Summary
|
10 |
summary_ids = model.generate(inputs['input_ids'], num_beams=4, max_length=5, early_stopping=True)
|
11 |
-
print([tokenizer.decode(g, skip_special_tokens=True, clean_up_tokenization_spaces=False) for g in summary_ids])
|
|
|
|
1 |
+
The distilbart-cnn-12-6-text2sql is fine-tuned on WIKISQL dataset.
|
2 |
+
```python
|
3 |
from transformers import BartTokenizer, BartForConditionalGeneration, BartConfig
|
4 |
|
5 |
model = BartForConditionalGeneration.from_pretrained('facebook/bart-large-cnn')
|
|
|
10 |
|
11 |
# Generate Summary
|
12 |
summary_ids = model.generate(inputs['input_ids'], num_beams=4, max_length=5, early_stopping=True)
|
13 |
+
print([tokenizer.decode(g, skip_special_tokens=True, clean_up_tokenization_spaces=False) for g in summary_ids])
|
14 |
+
```
|