def METHOD_NAME(self, args, from_checkpoint=False):
    from fairseq import models
    model = models.METHOD_NAME(args, self, from_checkpoint)
    model.register_classification_head(
        getattr(args, "ranking_head_name", "sentence_classification_head"),
        num_classes=1,
    )
    return model