nemo_curator.utils.hf_download_utils
nemo_curator.utils.hf_download_utils
nemo_curator.utils.hf_download_utils
Download a model from Hugging Face.
This function downloads either a specific file or the entire model repository from Hugging Face Hub to a local directory.
Parameters:
The Hugging Face model identifier (e.g., ‘gpt2’, ‘bert-base-uncased’)
Local directory where the model will be downloaded
List of glob patterns to ignore when downloading. Only used when filename is not provided. Defaults to None.
Specific file to download from the repository. If provided, only this file will be downloaded and ignore_patterns will be ignored. Defaults to None.
Git revision (branch, tag, or commit hash) to download. Defaults to None (latest main branch).
Raises:
ValueError: If both filename and ignore_patterns are provided (not supported).Examples: