def _determine_model_folder(model_name: str, default_root_dir: str) -> str:
    """Determine the local model folder based on the model registry.

    Args:
        model_name: The model name
        default_root_dir: The default root directory

    Returns:
        string path to the local model folder

    >>> _determine_model_folder("model-name", "/path/to/root")
    '/path/to/root/model-name'
    >>> _determine_model_folder("model-name:1.0", "/path/to/root")
    '/path/to/root/model-name_1.0'

    """
    if not model_name:
        raise ValueError(f"Invalid model registry: '{model_name}'")
    # download the latest checkpoint from the model registry
    model_name = model_name.replace("/", "_")
    model_name = model_name.replace(":", "_")
    local_model_dir = os.path.join(default_root_dir, model_name)
    return local_model_dir
Determine the local model folder based on the model registry.

    Args:
        model_name: The model name
        default_root_dir: The default root directory

    Returns:
        string path to the local model folder

    >>> _determine_model_folder("model-name", "/path/to/root")
    '/path/to/root/model-name'
    >>> _determine_model_folder("model-name:1.0", "/path/to/root")
    '/path/to/root/model-name_1.0'

    
src/lightning/pytorch/utilities/model_registry.py