Skip to content

Commit

Permalink
adding pad token to fix huggingface#28534
Browse files Browse the repository at this point in the history
  • Loading branch information
JINO-ROHIT committed Apr 10, 2024
1 parent 1f57dc7 commit 5e68f6a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/pytorch/text-classification/run_glue_no_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,8 @@ def main():
tokenizer = AutoTokenizer.from_pretrained(
args.model_name_or_path, use_fast=not args.use_slow_tokenizer, trust_remote_code=args.trust_remote_code
)
tokenizer.pad_token = tokenizer.eos_token
if tokenizer.pad_token is None:
tokenizer.pad_token = tokenizer.eos_token
config.pad_token_id = tokenizer.pad_token_id

model = AutoModelForSequenceClassification.from_pretrained(
Expand Down

0 comments on commit 5e68f6a

Please sign in to comment.