yeomtong commited on
Commit
b44c3dc
·
verified ·
1 Parent(s): 262e36b

Update model.py

Browse files
Files changed (1) hide show
  1. model.py +4 -2
model.py CHANGED
@@ -17,7 +17,8 @@ class PredicateAwareSRL(nn.Module):
17
  max_distance: int = 128): # NEW: clamp |i - p| to this range for bucketing
18
  super().__init__()
19
  self.config = AutoConfig.from_pretrained(bert_name)
20
- self.bert = AutoModel.from_pretrained(bert_name)
 
21
  self.use_indicator = use_indicator
22
 
23
  # --- Input dim to BiLSTM = BERT_dim + (indicator_dim) + (pos_dim)
@@ -75,7 +76,8 @@ class PredicateAwareSRL(nn.Module):
75
  device = input_ids.device
76
 
77
  # ---- BERT encoder
78
- bert_out = self.bert(
 
79
  input_ids=input_ids,
80
  token_type_ids=token_type_ids,
81
  attention_mask=attention_mask
 
17
  max_distance: int = 128): # NEW: clamp |i - p| to this range for bucketing
18
  super().__init__()
19
  self.config = AutoConfig.from_pretrained(bert_name)
20
+ # self.bert = AutoModel.from_pretrained(bert_name)
21
+ self.encoder = AutoModel.from_pretrained(bert_name)
22
  self.use_indicator = use_indicator
23
 
24
  # --- Input dim to BiLSTM = BERT_dim + (indicator_dim) + (pos_dim)
 
76
  device = input_ids.device
77
 
78
  # ---- BERT encoder
79
+ # bert_out = self.bert(
80
+ bert_out = self.encoder(
81
  input_ids=input_ids,
82
  token_type_ids=token_type_ids,
83
  attention_mask=attention_mask