test_dynamic_model / modeling.py
sgugger's picture
Initial commit
2efddce
raw
history blame
304 Bytes
import torch
from transformers import BertModel
from .configuration import NewModelConfig
class NewModel(BertModel):
config_class = NewModelConfig
def __init__(self, config):
super().__init__(config)
self.last_layer = torch.nn.Linear(config.hidden_size, config.new_hidden_size)