From 57a6626929f0e47b2de5fd58040d413ee34dc676 Mon Sep 17 00:00:00 2001 From: Yusuke Mori Date: Tue, 5 Jan 2021 22:15:06 +0900 Subject: [PATCH] [examples/text-classification] Fix a bug for using one's own dataset of a regression task (#9411) --- examples/text-classification/run_glue.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/text-classification/run_glue.py b/examples/text-classification/run_glue.py index afe9cd9761..1ae47e6923 100644 --- a/examples/text-classification/run_glue.py +++ b/examples/text-classification/run_glue.py @@ -289,7 +289,7 @@ def main(): f"model labels: {list(sorted(label_name_to_id.keys()))}, dataset labels: {list(sorted(label_list))}." "\nIgnoring the model labels as a result.", ) - elif data_args.task_name is None: + elif data_args.task_name is None and not is_regression: label_to_id = {v: i for i, v in enumerate(label_list)} def preprocess_function(examples):