[examples/text-classification] Fix a bug for using one's own dataset of a regression task (#9411)

This commit is contained in:
Yusuke Mori
2021-01-05 22:15:06 +09:00
committed by GitHub
parent 189387e9b2
commit 57a6626929

View File

@@ -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):