LinuxCommandLibrary

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 to specific directory
$ huggingface-cli download [model-name] --cache-dir [path]
copy
Download specific files
$ huggingface-cli download [model-name] [config.json] [model.safetensors]
copy
Upload a file
$ huggingface-cli upload [repo-id] [file]
copy
Logout
$ huggingface-cli logout
copy

SYNOPSIS

huggingface-cli command [options]

DESCRIPTION

huggingface-cli (also hf) is the command-line interface for Hugging Face Hub. Download models and datasets, manage repositories, and authenticate your machine. Part of the huggingfacehub Python package. Default cache location is ~/.cache/huggingface or HFHOME environment variable.

PARAMETERS

--token token

Use specific access token.
--cache-dir path
Download destination directory.

SUBCOMMANDS

login

Authenticate with Hugging Face Hub.
logout
Log out of Hugging Face Hub.
download repo [files]
Download files from the Hub.
upload repo files
Upload files to a repository.
repo
Manage repositories.
env
Display environment info.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community