Fix a bug in run_glue.py (#9812) (#9815)

This commit is contained in:
Yusuke Mori
2021-01-27 04:32:19 +09:00
committed by GitHub
parent eba418ac5d
commit 059bb25817

View File

@@ -317,7 +317,7 @@ def main():
if ( if (
model.config.label2id != PretrainedConfig(num_labels=num_labels).label2id model.config.label2id != PretrainedConfig(num_labels=num_labels).label2id
and data_args.task_name is not None and data_args.task_name is not None
and is_regression and not is_regression
): ):
# Some have all caps in their config, some don't. # Some have all caps in their config, some don't.
label_name_to_id = {k.lower(): v for k, v in model.config.label2id.items()} label_name_to_id = {k.lower(): v for k, v in model.config.label2id.items()}