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
d59464db
Unverified
Commit
d59464db
authored
Mar 08, 2021
by
Oren Amsalem
Committed by
GitHub
Mar 08, 2021
Browse files
fix BART Summarization example in doc (#10582)
parent
3b583d02
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
src/transformers/models/bart/modeling_bart.py
src/transformers/models/bart/modeling_bart.py
+2
-2
No files found.
src/transformers/models/bart/modeling_bart.py
View file @
d59464db
...
@@ -529,8 +529,8 @@ BART_GENERATION_EXAMPLE = r"""
...
@@ -529,8 +529,8 @@ BART_GENERATION_EXAMPLE = r"""
>>> from transformers import BartTokenizer, BartForConditionalGeneration, BartConfig
>>> from transformers import BartTokenizer, BartForConditionalGeneration, BartConfig
>>> model = BartForConditionalGeneration.from_pretrained('facebook/bart-large')
>>> model = BartForConditionalGeneration.from_pretrained('facebook/bart-large
-cnn
')
>>> tokenizer = BartTokenizer.from_pretrained('facebook/bart-large')
>>> 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([ARTICLE_TO_SUMMARIZE], max_length=1024, return_tensors='pt')
>>> inputs = tokenizer([ARTICLE_TO_SUMMARIZE], max_length=1024, return_tensors='pt')
...
...
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