Unverified Commit 57a66269 authored by Yusuke Mori's avatar Yusuke Mori Committed by GitHub
Browse files

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

parent 189387e9
...@@ -289,7 +289,7 @@ def main(): ...@@ -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):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment