File size: 541 Bytes
9e3752d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
from transformers import PreTrainedModel
from .unet import UNet
from .unet_config import UNetConfig
class UNetModel(PreTrainedModel):
config_class = UNetConfig
def __init__(self, config: UNetConfig):
super().__init__(config)
self.model = UNet(
in_channels=config.in_channels,
out_channels=config.out_channels,
pad=config.pad,
bilinear=config.bilinear,
normalization=config.normalization,
)
def forward(self, x):
return self.model(x)
|