def extract_epoch(filename):
    """
    Get the epoch from a model save string formatted as name_Epoch:{seed}.pt
    :param str: Model save name
    :return: epoch (int)
    """

    if "epoch" not in filename.lower():
        return 0

    epoch = int(filename.lower().split("epoch_")[-1].replace(".pt", ""))
    return epoch