sincecutoff.com
← all changes

hf upload and hf download accept hf:// URIs

Introduced 2026-06-11 · score 0.98

HOW TO USE IT

When uploading or downloading a repository file by URI, pass `hf://[<TYPE>/]<ID>[@<REVISION>][/<PATH>]` as the repository destination/source. Keep the URI as the source of repo type, revision, and path; omit `--repo-type` and `--revision`, and omit `path_in_repo` for upload or positional filenames for download when the URI contains a path.

hf download hf://datasets/HuggingFaceM4/FineVision@refs/pr/1/data/train.parquet
hf upload hf://datasets/Wauplin/my-cool-dataset@my-branch/data/train.csv ./train.csv

WHY THIS HELPS

Upload or download a repository file using a single URI that specifies its repository type, revision, and path.

BEFORE THIS CHANGE

Pass repository ID, repo type and revision separately; supply the file path as a download positional filename or upload `path_in_repo`.

REQUIREMENTS AND LIMITATIONS

  • Version: v1.19.0
  • URI `<TYPE>`: Optional repository type, such as `datasets`; when omitted, the URI defaults to a model repository.
  • URI `<ID>` (required): Repository ID.
  • URI `<REVISION>`: Revision such as a branch, tag, or commit; URI encodes it, so do not also set `--revision`.
  • URI `<PATH>`: File or subfolder path in the repository; when present, do not also pass positional filenames to download or `path_in_repo` to upload.
  • `local_path` (required): Upload source file or folder on the local machine.
  • `--repo-type`: Normally selects repository type; cannot be set when using an `hf://` URI.
  • `--revision`: Normally selects revision; cannot be set when using an `hf://` URI.
  • Prerequisite: Install the `hf` CLI; the v1.19.0 guide documents the standalone installer, pip, and Homebrew options.
  • Prerequisite: Uploading requires a token; the CLI uses the locally saved token from `hf auth login` by default.
  • Prerequisite: Accessing private or gated repositories for download requires a token; a locally saved token is used by default.
  • A URI with a path cannot be combined with positional filenames for download or `path_in_repo` for upload.

FIRST-PARTY EVIDENCE

Check the installed version and the source before using it. Entry JSON

Report a problem with this card