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
6af3306a
Unverified
Commit
6af3306a
authored
May 03, 2020
by
Lorenzo Ampil
Committed by
GitHub
May 03, 2020
Browse files
Add decoder specific error message for T5Stack.forward (#4128)
parent
1cdd2ad2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
src/transformers/modeling_t5.py
src/transformers/modeling_t5.py
+4
-1
No files found.
src/transformers/modeling_t5.py
View file @
6af3306a
...
@@ -666,7 +666,10 @@ class T5Stack(T5PreTrainedModel):
...
@@ -666,7 +666,10 @@ class T5Stack(T5PreTrainedModel):
elif
inputs_embeds
is
not
None
:
elif
inputs_embeds
is
not
None
:
input_shape
=
inputs_embeds
.
size
()[:
-
1
]
input_shape
=
inputs_embeds
.
size
()[:
-
1
]
else
:
else
:
raise
ValueError
(
"You have to specify either input_ids or inputs_embeds"
)
if
self
.
is_decoder
:
raise
ValueError
(
"You have to specify either decoder_input_ids or decoder_inputs_embeds"
)
else
:
raise
ValueError
(
"You have to specify either input_ids or inputs_embeds"
)
if
inputs_embeds
is
None
:
if
inputs_embeds
is
None
:
assert
self
.
embed_tokens
is
not
None
,
"You have to intialize the model with valid token embeddings"
assert
self
.
embed_tokens
is
not
None
,
"You have to intialize the model with valid token embeddings"
...
...
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