MCPcopy Create free account
hub / github.com/OFA-Sys/OFA / __init__

Method __init__

models/sequence_generator.py:777–789  ·  view source on GitHub ↗
(self, models)

Source from the content-addressed store, hash-verified

775 """A wrapper around an ensemble of models."""
776
777 def __init__(self, models):
778 super().__init__()
779 self.models_size = len(models)
780 # method '__len__' is not supported in ModuleList for torch script
781 self.single_model = models[0]
782 self.models = nn.ModuleList(models)
783
784 self.has_incremental: bool = False
785 if all(
786 hasattr(m, "decoder") and isinstance(m.decoder, FairseqIncrementalDecoder)
787 for m in models
788 ):
789 self.has_incremental = True
790
791 def forward(self):
792 pass

Callers 3

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected