Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
754202de
Unverified
Commit
754202de
authored
Nov 17, 2021
by
Patrick von Platen
Committed by
GitHub
Nov 17, 2021
Browse files
[Bart] Fix docs (#14434)
parent
7544efc9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
docs/source/model_doc/bart.rst
docs/source/model_doc/bart.rst
+1
-1
No files found.
docs/source/model_doc/bart.rst
View file @
754202de
...
@@ -74,7 +74,7 @@ The :obj:`facebook/bart-base` and :obj:`facebook/bart-large` checkpoints can be
...
@@ -74,7 +74,7 @@ The :obj:`facebook/bart-base` and :obj:`facebook/bart-large` checkpoints can be
..
code
-
block
::
..
code
-
block
::
from
transformers
import
BartForConditionalGeneration
,
BartTokenizer
from
transformers
import
BartForConditionalGeneration
,
BartTokenizer
model
=
BartForConditionalGeneration
.
from_pretrained
(
"facebook/bart-large"
,
force_bos_token_
to_be_generated
=
True
)
model
=
BartForConditionalGeneration
.
from_pretrained
(
"facebook/bart-large"
,
force
d
_bos_token_
id
=
0
)
tok
=
BartTokenizer
.
from_pretrained
(
"facebook/bart-large"
)
tok
=
BartTokenizer
.
from_pretrained
(
"facebook/bart-large"
)
example_english_phrase
=
"UN Chief Says There Is No <mask> in Syria"
example_english_phrase
=
"UN Chief Says There Is No <mask> in Syria"
batch
=
tok
(
example_english_phrase
,
return_tensors
=
'pt'
)
batch
=
tok
(
example_english_phrase
,
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