diff --git a/examples/run_glue.py b/examples/run_glue.py index ec76dadcfe..547a4e4698 100644 --- a/examples/run_glue.py +++ b/examples/run_glue.py @@ -183,10 +183,10 @@ def evalutate(args, eval_task, eval_output_dir, dataset, model): nb_eval_steps += 1 if preds is None: preds = logits.detach().cpu().numpy() - out_label_ids = label_ids.detach().cpu().numpy() + out_label_ids = inputs['labels'].detach().cpu().numpy() else: preds = np.append(preds, logits.detach().cpu().numpy(), axis=0) - out_label_ids = np.append(out_label_ids, label_ids.detach().cpu().numpy(), axis=0) + out_label_ids = np.append(out_label_ids, inputs['labels'].detach().cpu().numpy(), axis=0) eval_loss = eval_loss / nb_eval_steps if args.output_mode == "classification": diff --git a/pytorch_transformers/modeling_bert.py b/pytorch_transformers/modeling_bert.py index 71045d1694..7cb723b563 100644 --- a/pytorch_transformers/modeling_bert.py +++ b/pytorch_transformers/modeling_bert.py @@ -176,7 +176,7 @@ class BertConfig(PretrainedConfig): initializing all weight matrices. layer_norm_eps: The epsilon used by LayerNorm. """ - pretrained_config_archive_map = PRETRAINED_CONFIG_ARCHIVE_MAP + pretrained_config_archive_map = BERT_PRETRAINED_CONFIG_ARCHIVE_MAP def __init__(self, vocab_size_or_config_json_file=30522,