Views
No views yet
1from transformers import BartTokenizer, BartModel
2
3tokenizer = BartTokenizer.from_pretrained('facebook/bart-large')
4model = BartModel.from_pretrained('facebook/bart-large')
5
6inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
7outputs = model(**inputs)
8
9last_hidden_states = outputs.last_hidden_state1@article{DBLP:journals/corr/abs-1910-13461,
2 author = {Mike Lewis and
3 Yinhan Liu and
4 Naman Goyal and
5 Marjan Ghazvininejad and
6 Abdelrahman Mohamed and
7 Omer Levy and
8 Veselin Stoyanov and
9 Luke Zettlemoyer},
10 title = {{BART:} Denoising Sequence-to-Sequence Pre-training for Natural Language
11 Generation, Translation, and Comprehension},
12 journal = {CoRR},
13 volume = {abs/1910.13461},
14 year = {2019},
15 url = {http://arxiv.org/abs/1910.13461},
16 eprinttype = {arXiv},
17 eprint = {1910.13461},
18 timestamp = {Thu, 31 Oct 2019 14:02:26 +0100},
19 biburl = {https://dblp.org/rec/journals/corr/abs-1910-13461.bib},
20 bibsource = {dblp computer science bibliography, https://dblp.org}
21}