UNCANNY69 commited on
Commit
724ef60
·
verified ·
1 Parent(s): e888192

Update model.py

Browse files
Files changed (1) hide show
  1. model.py +4 -2
model.py CHANGED
@@ -1,8 +1,10 @@
1
  from transformers import BertModel, BertConfig
 
2
  from transformers.modeling_outputs import BaseModelOutputWithPooling
3
  import torch.nn as nn
4
  import torch.nn.functional as F
5
- from transformers import PreTrainedModel, SequenceClassifierOutput
 
6
  from transformers import PretrainedConfig
7
 
8
  class BertLSTMConfig(PretrainedConfig):
@@ -31,7 +33,7 @@ class BertLSTMConfig(PretrainedConfig):
31
  }
32
 
33
 
34
- class BertLSTMForSequenceClassification(PreTrainedModel):
35
  config_class = BertLSTMConfig
36
 
37
  def __init__(self, config):
 
1
  from transformers import BertModel, BertConfig
2
+ from abc import ABCMeta
3
  from transformers.modeling_outputs import BaseModelOutputWithPooling
4
  import torch.nn as nn
5
  import torch.nn.functional as F
6
+ from transformers.modeling_outputs import SequenceClassifierOutput
7
+ from transformers import PreTrainedModelt
8
  from transformers import PretrainedConfig
9
 
10
  class BertLSTMConfig(PretrainedConfig):
 
33
  }
34
 
35
 
36
+ class BertLSTMForSequenceClassification(PreTrainedModel,, metaclass=ABCMeta):
37
  config_class = BertLSTMConfig
38
 
39
  def __init__(self, config):