mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 02:02:21 +06:00
Fix id2label assignment in run_classification.py (#28590)
This commit is contained in:
parent
83f9196cc4
commit
f0acf7b6d8
@ -545,7 +545,7 @@ def main():
|
||||
"run. You can ignore this if you are doing finetuning."
|
||||
)
|
||||
model.config.label2id = label_to_id
|
||||
model.config.id2label = {id: label for label, id in config.label2id.items()}
|
||||
model.config.id2label = {id: label for label, id in label_to_id.items()}
|
||||
elif not is_regression: # classification, but not training
|
||||
logger.info("using label infos in the model config")
|
||||
logger.info("label2id: {}".format(model.config.label2id))
|
||||
|
Loading…
Reference in New Issue
Block a user