prevent BERT weights from being downloaded twice

This commit is contained in:
Rémi Louf authored and Julien Chaumond committed 2019-12-09 20:37:55 -05:00
1 parent 5909f71028
commit 076602bdc4
1 file changed
+2 -1
+2 -1
View File
@@ -158,7 +158,8 @@ class Bert(nn.Module):
def __init__(self): def __init__(self):
super(Bert, self).__init__() super(Bert, self).__init__()
self.model = BertModel.from_pretrained("bert-base-uncased") config = BertConfig.from_pretrained("bert-base-uncased")
self.model = BertModel(config)
def forward(self, input_ids, attention_mask=None, token_type_ids=None, **kwargs): def forward(self, input_ids, attention_mask=None, token_type_ids=None, **kwargs):
self.eval() self.eval()