Deal with the error when task is regression (#16330)

This commit is contained in:
fireindark707
2022-06-01 23:15:53 +08:00
committed by GitHub
parent 84aaadd8c5
commit 028d4b7c8b

View File

@@ -343,7 +343,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 args.task_name is None:
elif args.task_name is None and not is_regression:
label_to_id = {v: i for i, v in enumerate(label_list)}
if label_to_id is not None: