LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

huggingface-cli

command-line interface for Hugging Face Hub

TLDR

Login to Hugging Face
$ huggingface-cli login
copy
Download a model
$ huggingface-cli download [model-name]
copy
Download specific files from a model
$ huggingface-cli download [model-name] [config.json] [model.safetensors]
copy
Download to a local directory
$ huggingface-cli download [model-name] --local-dir [path]
copy
Download a dataset
$ huggingface-cli download [dataset-name] --repo-type dataset
copy
Upload a folder to a repo
$ huggingface-cli upload [repo-id] [local_path] [path_in_repo]
copy
Scan the local cache
$ huggingface-cli scan-cache
copy
Show current logged-in user
$ huggingface-cli whoami
copy

SYNOPSIS

huggingface-cli command [options]

DESCRIPTION

huggingface-cli is the command-line interface for Hugging Face Hub, also available as the hf command. Download models and datasets, manage repositories, and authenticate your machine. Part of the huggingfacehub Python package. The newer **hf** CLI uses a resource-action pattern (e.g. `hf auth login`, `hf download`). Default cache location is ~/.cache/huggingface or HFHOME environment variable.

PARAMETERS

--token token

Use specific access token.
--repo-type type
Repository type: model, dataset, or space (default: model).
--local-dir path
Download to a specific local directory instead of cache.
--include pattern
Glob pattern for files to include in download.
--exclude pattern
Glob pattern for files to exclude from download.
--revision rev
Specific revision to download (branch, tag, or commit hash).
--quiet
Suppress progress output.

SUBCOMMANDS

login

Authenticate with Hugging Face Hub.
logout
Log out of Hugging Face Hub.
whoami
Show current logged-in user and organizations.
download repo [files]
Download files from the Hub.
upload repo [localpath] [pathinrepo_]
Upload files or folders to a repository.
upload-large-folder repo localpath_
Upload a large folder with resumable chunked uploads.
repo create repo
Create a new repository on the Hub.
scan-cache
Scan and report on the local cache directory.
delete-cache
Interactively delete unused cache revisions.
tag repo tag
Tag a repository with a version.
env
Display environment and library info.

SEE ALSO

pip(1)

Copied to clipboard
Kai