def __init__(self, load_weights=True, segmenting_in_forward=True):
        """
        @param load_weights: whether to load the weights from the default checkpoint, default is True
        @param segmenting_in_forward: whether to segment and pad the input in the forward pass, default is True.
        If False (the preferred option for training/fine-tuning), the input must have shape (batch, 122880)
        """
        super().__init__()
        self.cnn = _ComplexSpecCNN(CNN_FINAL_CHANNELS, N_LAYERS_CNN)
        fdim = self.cnn.fdim_cnn_out
        transformer_pool_attn_conf = Config(
            "",
            None,
            feat_seq_len=FEAT_SEQ_LEN,
            dim_transformer=DIM_TRANSFORMER,
            xlsr_name=None,
            nhead_transformer=N_HEADS,
            nlayers_transformer=N_LAYERS_TRANSFORMER,
        )
        # override the input dimension
        transformer_pool_attn_conf.dim_input = CNN_FINAL_CHANNELS * fdim
        self.transformer_pool_attn = SingleLayerModel(transformer_pool_attn_conf)
        self.segmenting_in_forward = segmenting_in_forward

        if load_weights:
            chkpt = torch.load(DEFAULT_WEIGHTS_CHKPT, map_location="cpu", weights_only=True)
            self.load_state_dict(chkpt["model"])
            print("DistillMOS variant 7 weights loaded from:", DEFAULT_WEIGHTS_CHKPT)

        @param load_weights: whether to load the weights from the default checkpoint, default is True
        @param segmenting_in_forward: whether to segment and pad the input in the forward pass, default is True.
        If False (the preferred option for training/fine-tuning), the input must have shape (batch, 122880)
        
speechscore/scores/distill_mos/sqa.py