Skip to content

Commit c25f83c

Browse files
authored
fix missing pad token (#5690)
Co-authored-by: Edenzzzz <[email protected]>
1 parent d3f34ee commit c25f83c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

examples/language/gpt/hybridparallelism/finetune.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,12 @@ def main():
243243
# ====================================
244244
# gpt2 pretrained model
245245

246-
cfg = AutoConfig.from_pretrained(model_name, num_labels=data_builder.num_labels)
246+
cfg = AutoConfig.from_pretrained(
247+
model_name,
248+
num_labels=data_builder.num_labels,
249+
pad_token=data_builder.tokenizer.pad_token,
250+
pad_token_id=data_builder.tokenizer.pad_token_id,
251+
)
247252

248253
if model_name == "gpt2":
249254
model = GPT2ForSequenceClassification.from_pretrained(model_name, config=cfg).cuda()

0 commit comments

Comments
 (0)