Update model.py
Browse files
model.py
CHANGED
|
@@ -17,8 +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 |
-
|
| 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,8 +76,8 @@ class PredicateAwareSRL(nn.Module):
|
|
| 76 |
device = input_ids.device
|
| 77 |
|
| 78 |
# ---- BERT encoder
|
| 79 |
-
|
| 80 |
-
bert_out = self.encoder(
|
| 81 |
input_ids=input_ids,
|
| 82 |
token_type_ids=token_type_ids,
|
| 83 |
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
|