Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
18a0150b
Unverified
Commit
18a0150b
authored
Jun 22, 2020
by
Zihao Fu
Committed by
GitHub
Jun 22, 2020
Browse files
fix bart doc (#5132)
fix bart doc
parent
3fe75c7f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
src/transformers/modeling_bart.py
src/transformers/modeling_bart.py
+2
-2
No files found.
src/transformers/modeling_bart.py
View file @
18a0150b
...
@@ -60,8 +60,8 @@ BART_GENERATION_EXAMPLE = r"""
...
@@ -60,8 +60,8 @@ BART_GENERATION_EXAMPLE = r"""
from transformers import BartTokenizer, BartForConditionalGeneration, BartConfig
from transformers import BartTokenizer, BartForConditionalGeneration, BartConfig
# see ``examples/summarization/bart/run_eval.py`` for a longer example
# see ``examples/summarization/bart/run_eval.py`` for a longer example
model = BartForConditionalGeneration.from_pretrained('bart-large-cnn')
model = BartForConditionalGeneration.from_pretrained('
facebook/
bart-large-cnn')
tokenizer = BartTokenizer.from_pretrained('bart-large-cnn')
tokenizer = BartTokenizer.from_pretrained('
facebook/
bart-large-cnn')
ARTICLE_TO_SUMMARIZE = "My friends are cool but they eat too many carbs."
ARTICLE_TO_SUMMARIZE = "My friends are cool but they eat too many carbs."
inputs = tokenizer.batch_encode_plus([ARTICLE_TO_SUMMARIZE], max_length=1024, return_tensors='pt')
inputs = tokenizer.batch_encode_plus([ARTICLE_TO_SUMMARIZE], max_length=1024, return_tensors='pt')
# Generate Summary
# Generate Summary
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment