Skip to content

Commit 54409fa

Browse files
authored
[prompt] fix bug when no mask token in template (#3924)
1 parent 6308169 commit 54409fa

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

paddlenlp/prompt/prompt_trainer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,8 @@ def forward(self,
366366
k: input_dict[k]
367367
for k in input_dict if k in self.forward_keys
368368
}
369-
model_inputs["masked_positions"] = None
369+
if "masked_positions" in model_inputs:
370+
model_inputs.pop("masked_positions")
370371
outputs = self.plm(**model_inputs)
371372
if self.verbalizer is not None:
372373
label_outputs = self.verbalizer.process_outputs(

0 commit comments

Comments
 (0)