Last active
March 14, 2020 17:22
-
-
Save khuangaf/d6e4c8b8b369d7864868884927250c56 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CustomBERTModel(BertPreTrainedModel): | |
def __init__(self, config, num_class): | |
super(CustomBERTModel, self).__init__(config) | |
self.bert = BertModel(config) | |
self.linear = nn.Linear(config.hidden_size, num_class) | |
model = CustomBERTModel.from_pretrained('bert-base-uncased',num_class=10) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment