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
4bafc43b
Unverified
Commit
4bafc43b
authored
Dec 23, 2020
by
Xu Song
Committed by
GitHub
Dec 23, 2020
Browse files
Fix param error (#9273)
TypeError: forward() got an unexpected keyword argument 'token_type_ids'
parent
58e8a761
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
src/transformers/models/bert_generation/modeling_bert_generation.py
...ormers/models/bert_generation/modeling_bert_generation.py
+2
-2
No files found.
src/transformers/models/bert_generation/modeling_bert_generation.py
View file @
4bafc43b
...
...
@@ -130,7 +130,7 @@ def load_tf_weights_in_bert_generation(
class
BertGenerationEmbeddings
(
nn
.
Module
):
"""Construct the embeddings from word
,
position
and token_type
embeddings."""
"""Construct the embeddings from word
and
position embeddings."""
def
__init__
(
self
,
config
):
super
().
__init__
()
...
...
@@ -468,7 +468,7 @@ class BertGenerationDecoder(BertGenerationPreTrainedModel):
>>> config.is_decoder = True
>>> model = BertGenerationDecoder.from_pretrained('google/bert_for_seq_generation_L-24_bbc_encoder', config=config)
>>> inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
>>> inputs = tokenizer("Hello, my dog is cute",
return_token_type_ids=False,
return_tensors="pt")
>>> outputs = model(**inputs)
>>> prediction_logits = outputs.logits
...
...
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