def METHOD_NAME(
    model_class: Type,
    pretrained_model_name_or_path: Optional[Union[str, PathLike]],
    **pretrained_kwargs,
) -> PreTrainedModel:
    """Download a HuggingFace model.
    Downloads a model from the HuggingFace zoo with retry on failure.
    Args:
        model_class: Class of the model to download.
        pretrained_model_name_or_path: Name of the model to download.
        pretrained_kwargs: Additional arguments to pass to the model constructor.
    Returns:
        The pretrained model object.
    """
    return model_class.from_pretrained(pretrained_model_name_or_path, **pretrained_kwargs)