    def build_model(cls, cfg: AudioClassificationConfig, task: FairseqTask):
        """Build a new model instance."""

        assert hasattr(task, "labels"), f"Task {task} must have an attribute 'labels'"

        return cls(cfg, len(task.labels))
Build a new model instance.
examples/data2vec/models/audio_classification.py