in src/huggingface_hub/commands/download.py [0:0]
def register_subcommand(parser: _SubParsersAction):
download_parser = parser.add_parser("download", help="Download files from the Hub")
download_parser.add_argument(
"repo_id", type=str, help="ID of the repo to download from (e.g. `username/repo-name`)."
)
download_parser.add_argument(
"filenames", type=str, nargs="*", help="Files to download (e.g. `config.json`, `data/metadata.jsonl`)."
)
download_parser.add_argument(
"--repo-type",
choices=["model", "dataset", "space"],
default="model",
help="Type of repo to download from (defaults to 'model').",
)
download_parser.add_argument(
"--revision",
type=str,
help="An optional Git revision id which can be a branch name, a tag, or a commit hash.",
)
download_parser.add_argument(
"--include", nargs="*", type=str, help="Glob patterns to match files to download."
)
download_parser.add_argument(
"--exclude", nargs="*", type=str, help="Glob patterns to exclude from files to download."
)
download_parser.add_argument(
"--cache-dir", type=str, help="Path to the directory where to save the downloaded files."
)
download_parser.add_argument(
"--local-dir",
type=str,
help=(
"If set, the downloaded file will be placed under this directory. Check out"
" https://huggingface.co/docs/huggingface_hub/guides/download#download-files-to-local-folder for more"
" details."
),
)
download_parser.add_argument(
"--local-dir-use-symlinks",
choices=["auto", "True", "False"],
help=("Deprecated and ignored. Downloading to a local directory does not use symlinks anymore."),
)
download_parser.add_argument(
"--force-download",
action="store_true",
help="If True, the files will be downloaded even if they are already cached.",
)
download_parser.add_argument(
"--resume-download",
action="store_true",
help="Deprecated and ignored. Downloading a file to local dir always attempts to resume previously interrupted downloads (unless hf-transfer is enabled).",
)
download_parser.add_argument(
"--token", type=str, help="A User Access Token generated from https://huggingface.co/settings/tokens"
)
download_parser.add_argument(
"--quiet",
action="store_true",
help="If True, progress bars are disabled and only the path to the download files is printed.",
)
download_parser.add_argument(
"--max-workers",
type=int,
default=8,
help="Maximum number of workers to use for downloading files. Default is 8.",
)
download_parser.set_defaults(func=DownloadCommand)