浏览代码

adjust model_load

cdZWj 6 月之前
父节点
当前提交
f89f651e5b
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      PointerNet/model.py

+ 2 - 2
PointerNet/model.py

@@ -12,8 +12,8 @@ class UIEModel(nn.Module):
         bert_dir = args.bert_dir
         self.bert_config = BertConfig.from_pretrained(bert_dir)
         self.bert_model = BertModel.from_pretrained(bert_dir)
-        self.bert_model.load_state_dict(torch.load(self.args.bert_pt_dir, map_location="cuda"))
-        self.bert_model = BertForSequenceClassification.from_pretrained(args.bert_pt_dir)
+        # self.bert_model.load_state_dict(torch.load(self.args.bert_pt_dir, map_location="cuda"))
+        # self.bert_model = BertForSequenceClassification.from_pretrained(args.bert_pt_dir)
 
         if "ner" in args.tasks:
             self.ner_num_labels = args.ner_num_labels