File size: 350 Bytes
ccbf044 1ca0f10 ccbf044 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
from transformers import PreTrainedModel, BertConfig, AutoModel
class Model(PreTrainedModel):
config_class = BertConfig
def __init__(self, config):
super().__init__(config)
self.model = AutoModel.from_pretrained("bert-base-uncased")
def forward(self, **inputs):
outs = self.model(**inputs)
return outs
|