poet70's picture
Upload folder using huggingface_hub
ac29381 verified
Raw
History Blame Contribute Delete
395 Bytes
from abc import ABC, abstractmethod
from torch import nn
from transformers.feature_extraction_utils import BatchFeature
class Backbone(ABC, nn.Module):
def __init__(self):
super(Backbone, self).__init__()
@abstractmethod
def forward(self, backbone_input: BatchFeature) -> BatchFeature:
pass
def prepare_input(self, batch: dict) -> BatchFeature:
pass