[examples/text-classification] Fix a bug for using one's own dataset of a regression task (#9411)
This commit is contained in:
@@ -289,7 +289,7 @@ def main():
|
|||||||
f"model labels: {list(sorted(label_name_to_id.keys()))}, dataset labels: {list(sorted(label_list))}."
|
f"model labels: {list(sorted(label_name_to_id.keys()))}, dataset labels: {list(sorted(label_list))}."
|
||||||
"\nIgnoring the model labels as a result.",
|
"\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)}
|
label_to_id = {v: i for i, v in enumerate(label_list)}
|
||||||
|
|
||||||
def preprocess_function(examples):
|
def preprocess_function(examples):
|
||||||
|
|||||||
Reference in New Issue
Block a user