Skip to content

[Docs] Document missing parameters in hf_hub_url and preupload_lfs_files#4300

Merged
Wauplin merged 1 commit into
huggingface:mainfrom
aicayzer:feat/docs-undocumented-params-sweep
Jun 2, 2026
Merged

[Docs] Document missing parameters in hf_hub_url and preupload_lfs_files#4300
Wauplin merged 1 commit into
huggingface:mainfrom
aicayzer:feat/docs-undocumented-params-sweep

Conversation

@aicayzer

@aicayzer aicayzer commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Three more Args entries on public-API functions that were either missing or wrong, in the same shape as #4298 / #4289.

  • hf_hub_url() — Args block was missing endpoint. Completes the triple started in [Docs] Document missing endpoint and template_str parameters #4298 (which documented it on hf_hub_download and snapshot_download).
  • HfApi.preupload_lfs_files() — Args block listed operations but the actual signature parameter is additions. Renamed the entry to match. Also added the missing free_memory entry below num_threads.

No behaviour change.

Files changed

  • src/huggingface_hub/file_download.pyhf_hub_url Args: add endpoint
  • src/huggingface_hub/hf_api.pypreupload_lfs_files Args: rename operationsadditions, add free_memory

Verification

  • make style — clean
  • make quality — clean (ruff check, generated-file checks, ty check src all pass)

Note

Low Risk
Docstring-only changes with no code paths or behavior modified.

Overview
Doc-only updates to public API docstrings so they match the real signatures.

hf_hub_url — the Args section now documents optional endpoint (Hub base URL; defaults to HF_ENDPOINT), aligning with hf_hub_download / snapshot_download docs from earlier PRs.

HfApi.preupload_lfs_files — Args now use additions instead of the incorrect operations name, and document free_memory (default True: clears path_or_fileobj on each CommitOperationAdd after upload unless you need to reuse the objects).

No runtime or API behavior changes.

Reviewed by Cursor Bugbot for commit 204aa50. Bugbot is set up for automated code reviews on this repo. Configure here.

- file_download.py: add `endpoint` to hf_hub_url Args
- hf_api.py: fix preupload_lfs_files Args block — rename `operations`
  to `additions` (matches the actual parameter name) and add the
  missing `free_memory` entry

All three parameters are already in the signatures; this only fills
the docstrings. Same shape as huggingface#4298.

@Wauplin Wauplin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

@Wauplin Wauplin merged commit 26a6df1 into huggingface:main Jun 2, 2026
16 of 22 checks passed
@bot-ci-comment

bot-ci-comment Bot commented Jun 2, 2026

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@huggingface-hub-bot

Copy link
Copy Markdown
Contributor

This PR has been shipped as part of the v1.18.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants