Update saute_model.py
Browse files- saute_model.py +4 -4
saute_model.py
CHANGED
|
@@ -2,7 +2,7 @@ import torch
|
|
| 2 |
import torch.nn as nn
|
| 3 |
from transformers import PreTrainedModel, BertModel, BertTokenizerFast
|
| 4 |
from transformers.modeling_outputs import MaskedLMOutput
|
| 5 |
-
from config import SAUTEConfig
|
| 6 |
|
| 7 |
activation_to_class = {
|
| 8 |
"gelu" : nn.GELU,
|
|
@@ -108,15 +108,15 @@ class EDUSpeakerAwareMLM(nn.Module):
|
|
| 108 |
|
| 109 |
|
| 110 |
class UtteranceEmbedings(PreTrainedModel):
|
| 111 |
-
config_class = SAUTEConfig
|
| 112 |
|
| 113 |
-
def __init__(self, config
|
| 114 |
super().__init__(config)
|
| 115 |
|
| 116 |
self.lm_head = nn.Linear(config.hidden_size, config.vocab_size)
|
| 117 |
self.saute_unit = EDUSpeakerAwareMLM(config)
|
| 118 |
|
| 119 |
-
self.config
|
| 120 |
|
| 121 |
self.init_weights()
|
| 122 |
|
|
|
|
| 2 |
import torch.nn as nn
|
| 3 |
from transformers import PreTrainedModel, BertModel, BertTokenizerFast
|
| 4 |
from transformers.modeling_outputs import MaskedLMOutput
|
| 5 |
+
# from config import SAUTEConfig
|
| 6 |
|
| 7 |
activation_to_class = {
|
| 8 |
"gelu" : nn.GELU,
|
|
|
|
| 108 |
|
| 109 |
|
| 110 |
class UtteranceEmbedings(PreTrainedModel):
|
| 111 |
+
# config_class = SAUTEConfig
|
| 112 |
|
| 113 |
+
def __init__(self, config):
|
| 114 |
super().__init__(config)
|
| 115 |
|
| 116 |
self.lm_head = nn.Linear(config.hidden_size, config.vocab_size)
|
| 117 |
self.saute_unit = EDUSpeakerAwareMLM(config)
|
| 118 |
|
| 119 |
+
self.config = config
|
| 120 |
|
| 121 |
self.init_weights()
|
| 122 |
|