Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
```
|
2 |
+
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
3 |
+
|
4 |
+
tokenizer = AutoTokenizer.from_pretrained("facebook/bart-large")
|
5 |
+
model = AutoModelForSeq2SeqLM.from_pretrained("vadis/bart_scitldr", use_auth_token=True)
|
6 |
+
|
7 |
+
text = "Abstract of a paper."
|
8 |
+
batch = tok(text, return_tensors="pt")
|
9 |
+
generated_ids = model.generate(batch["input_ids"])
|
10 |
+
print(tok.batch_decode(generated_ids, skip_special_tokens=True))
|
11 |
+
```
|