guymorganb commited on
Commit
f5771b3
·
1 Parent(s): 9584225

Fix imports for LSG code: explicit BERT import + import math + logger

Browse files
Files changed (1) hide show
  1. modeling_lsg_bert.py +21 -1
modeling_lsg_bert.py CHANGED
@@ -1,10 +1,30 @@
1
  from logging import warn
2
- from transformers.models.bert.modeling_bert import *
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  import torch
4
  import torch.nn as nn
5
  from transformers.models.bert.configuration_bert import BertConfig
 
6
  import sys
7
 
 
 
 
 
8
  AUTO_MAP = {
9
  "AutoModel": "modeling_lsg_bert.LSGBertModel",
10
  "AutoModelForCausalLM": "modeling_lsg_bert.LSGBertLMHeadModel",
 
1
  from logging import warn
2
+ from transformers.models.bert.modeling_bert import (
3
+ BertPreTrainedModel,
4
+ BertEmbeddings,
5
+ BertModel,
6
+ BertForPreTraining,
7
+ BertForMaskedLM,
8
+ BertForNextSentencePrediction,
9
+ BertForSequenceClassification,
10
+ BertForMultipleChoice,
11
+ BertForTokenClassification,
12
+ BertForQuestionAnswering,
13
+ BertSelfOutput,
14
+ BertPooler,
15
+ BertEncoder,
16
+ BertLayer,
17
+ )
18
  import torch
19
  import torch.nn as nn
20
  from transformers.models.bert.configuration_bert import BertConfig
21
+ import math
22
  import sys
23
 
24
+ import logging
25
+ logger = logging.getLogger(__name__)
26
+
27
+
28
  AUTO_MAP = {
29
  "AutoModel": "modeling_lsg_bert.LSGBertModel",
30
  "AutoModelForCausalLM": "modeling_lsg_bert.LSGBertLMHeadModel",