testing-model-upload / modeling_resnet.py
farzadab's picture
Upload model
4b8b024 verified
raw
history blame
364 Bytes
import torch
from transformers import PreTrainedModel
from .configuration_resnet import ResnetConfig
class ResnetModel(PreTrainedModel):
config_class = ResnetConfig
def __init__(self, config):
super().__init__(config)
self.model = torch.nn.Linear(5, 10)
def forward(self, tensor):
return self.model.forward_features(tensor)