From c772d4d91eedf65e1cc12971dd7bd4f7232883d4 Mon Sep 17 00:00:00 2001 From: ZuoChen_BUPT Date: Mon, 18 Nov 2024 21:41:48 +0800 Subject: [PATCH] fix a typo bug where 'id2label' was incorrectly written as 'i2label' when reading config (#34637) fix a bug where 'id2label' was incorrectly written as 'i2label' when reading the config from pretrained config --- .../image-classification/run_image_classification_no_trainer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/pytorch/image-classification/run_image_classification_no_trainer.py b/examples/pytorch/image-classification/run_image_classification_no_trainer.py index 2c60b359bd..a7193e23dd 100644 --- a/examples/pytorch/image-classification/run_image_classification_no_trainer.py +++ b/examples/pytorch/image-classification/run_image_classification_no_trainer.py @@ -331,7 +331,7 @@ def main(): config = AutoConfig.from_pretrained( args.model_name_or_path, num_labels=len(labels), - i2label=id2label, + id2label=id2label, label2id=label2id, finetuning_task="image-classification", trust_remote_code=args.trust_remote_code,