mirror of
https://github.com/huggingface/transformers.git
synced 2025-08-01 18:51:14 +06:00
Input Embeddings should be assigned
cc @julien-c
This commit is contained in:
parent
bac51fba3a
commit
f09f42d4d3
@ -756,7 +756,7 @@ class XLNetModel(XLNetPreTrainedModel):
|
|||||||
input_ids = input_ids.transpose(0, 1).contiguous()
|
input_ids = input_ids.transpose(0, 1).contiguous()
|
||||||
qlen, bsz = input_ids.shape[0], input_ids.shape[1]
|
qlen, bsz = input_ids.shape[0], input_ids.shape[1]
|
||||||
elif inputs_embeds is not None:
|
elif inputs_embeds is not None:
|
||||||
inputs_embeds.transpose(0, 1).contiguous()
|
inputs_embeds = inputs_embeds.transpose(0, 1).contiguous()
|
||||||
qlen, bsz = inputs_embeds.shape[0], inputs_embeds.shape[1]
|
qlen, bsz = inputs_embeds.shape[0], inputs_embeds.shape[1]
|
||||||
else:
|
else:
|
||||||
raise ValueError("You have to specify either input_ids or inputs_embeds")
|
raise ValueError("You have to specify either input_ids or inputs_embeds")
|
||||||
|
Loading…
Reference in New Issue
Block a user