nemo_curator.utils.hf_download_utils
Module Contents
Functions
API
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:
model_id
The Hugging Face model identifier (e.g., ‘gpt2’, ‘bert-base-uncased’)
local_dir
Local directory where the model will be downloaded
ignore_patterns
List of glob patterns to ignore when downloading. Only used when filename is not provided. Defaults to None.
filename
Specific file to download from the repository. If provided, only this file will be downloaded and ignore_patterns will be ignored. Defaults to None.
revision
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: