in src/diarizers/models/model.py [0:0]
def to_pyannote_model(self):
"""Convert the current model to a pyannote segmentation model for use in pyannote pipelines."""
seg_model = PyanNet(sincnet={"stride": 10})
seg_model.hparams.update(self.model.hparams)
seg_model.sincnet = copy.deepcopy(self.model.sincnet)
seg_model.sincnet.load_state_dict(self.model.sincnet.state_dict())
seg_model.lstm = copy.deepcopy(self.model.lstm)
seg_model.lstm.load_state_dict(self.model.lstm.state_dict())
seg_model.linear = copy.deepcopy(self.model.linear)
seg_model.linear.load_state_dict(self.model.linear.state_dict())
seg_model.classifier = copy.deepcopy(self.model.classifier)
seg_model.classifier.load_state_dict(self.model.classifier.state_dict())
seg_model.activation = copy.deepcopy(self.model.activation)
seg_model.activation.load_state_dict(self.model.activation.state_dict())
seg_model.specifications = self.specifications
return seg_model