def get_encoder_params_state_from_cfg(cfg: DictConfig):
    """
    Selects the param values to be saved in a checkpoint, so that a trained model can be used for downstream
    tasks without the need to specify these parameter again
    :return: Dict of params to memorize in a checkpoint
    """
    return {
        "do_lower_case": cfg.do_lower_case,
        "pretrained_model_cfg": cfg.encoder.pretrained_model_cfg,
        "encoder_model_type": cfg.encoder.encoder_model_type,
        "pretrained_file": cfg.encoder.pretrained_file,
        "projection_dim": cfg.encoder.projection_dim,
        "sequence_length": cfg.encoder.sequence_length,
    }

    Selects the param values to be saved in a checkpoint, so that a trained model can be used for downstream
    tasks without the need to specify these parameter again
    :return: Dict of params to memorize in a checkpoint
    
se2/DPR/dpr/options.py