mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 10:12:23 +06:00
parent
3b1f5caff2
commit
783b0dd589
@ -881,7 +881,7 @@ class T5Stack(T5PreTrainedModel):
|
||||
if input_ids is not None and inputs_embeds is not None:
|
||||
err_msg_prefix = "decoder_" if self.is_decoder else ""
|
||||
raise ValueError(
|
||||
f"You cannot specify both {err_msg_prefix}inputs and {err_msg_prefix}inputs_embeds at the same time"
|
||||
f"You cannot specify both {err_msg_prefix}input_ids and {err_msg_prefix}inputs_embeds at the same time"
|
||||
)
|
||||
elif input_ids is not None:
|
||||
input_shape = input_ids.size()
|
||||
@ -890,7 +890,7 @@ class T5Stack(T5PreTrainedModel):
|
||||
input_shape = inputs_embeds.size()[:-1]
|
||||
else:
|
||||
err_msg_prefix = "decoder_" if self.is_decoder else ""
|
||||
raise ValueError(f"You have to specify either {err_msg_prefix}inputs or {err_msg_prefix}inputs_embeds")
|
||||
raise ValueError(f"You have to specify either {err_msg_prefix}input_ids or {err_msg_prefix}inputs_embeds")
|
||||
|
||||
if inputs_embeds is None:
|
||||
assert self.embed_tokens is not None, "You have to initialize the model with valid token embeddings"
|
||||
|
@ -625,7 +625,7 @@ class TFT5MainLayer(tf.keras.layers.Layer):
|
||||
if inputs["input_ids"] is not None and inputs["inputs_embeds"] is not None:
|
||||
err_msg_prefix = "decoder_" if self.is_decoder else ""
|
||||
raise ValueError(
|
||||
f"You cannot specify both {err_msg_prefix}inputs and {err_msg_prefix}inputs_embeds at the same time"
|
||||
f"You cannot specify both {err_msg_prefix}input_ids and {err_msg_prefix}inputs_embeds at the same time"
|
||||
)
|
||||
elif inputs["input_ids"] is not None:
|
||||
input_shape = shape_list(inputs["input_ids"])
|
||||
@ -634,7 +634,7 @@ class TFT5MainLayer(tf.keras.layers.Layer):
|
||||
input_shape = shape_list(inputs["inputs_embeds"])[:-1]
|
||||
else:
|
||||
err_msg_prefix = "decoder_" if self.is_decoder else ""
|
||||
raise ValueError(f"You have to specify either {err_msg_prefix}inputs or {err_msg_prefix}inputs_embeds")
|
||||
raise ValueError(f"You have to specify either {err_msg_prefix}input_ids or {err_msg_prefix}inputs_embeds")
|
||||
|
||||
if inputs["inputs_embeds"] is None:
|
||||
assert self.embed_tokens is not None, "You have to initialize the model with valid token embeddings"
|
||||
|
Loading…
Reference in New Issue
Block a user