def load_from_sharded_state_dict(model: nn.Module, ckpt_path: str, model_name: str = "model", strict=False):
    """
    Loads a model from a sharded checkpoint.

    Args:
        model (nn.Module): The model to load the checkpoint into.
        ckpt_path (str): The path to the checkpoint.
        model_name (str): The name of the model in the checkpoint.
        strict (bool): Whether to strictly enforce that the keys in the checkpoint match the keys in the model.
    """
    ckpt_io = GeneralCheckpointIO()
    ckpt_io.load_model(model, os.path.join(ckpt_path, model_name), strict=strict)

    Loads a model from a sharded checkpoint.

    Args:
        model (nn.Module): The model to load the checkpoint into.
        ckpt_path (str): The path to the checkpoint.
        model_name (str): The name of the model in the checkpoint.
        strict (bool): Whether to strictly enforce that the keys in the checkpoint match the keys in the model.
    
opensora/utils/ckpt.py