[Docs] Document missing parameters in hf_hub_url and preupload_lfs_files#4300
Merged
Wauplin merged 1 commit intoJun 2, 2026
Merged
Conversation
- 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.
|
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. |
Contributor
|
This PR has been shipped as part of the v1.18.0 release. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three more
Argsentries on public-API functions that were either missing or wrong, in the same shape as #4298 / #4289.hf_hub_url()— Args block was missingendpoint. Completes the triple started in [Docs] Document missing endpoint and template_str parameters #4298 (which documented it onhf_hub_downloadandsnapshot_download).HfApi.preupload_lfs_files()— Args block listedoperationsbut the actual signature parameter isadditions. Renamed the entry to match. Also added the missingfree_memoryentry belownum_threads.No behaviour change.
Files changed
src/huggingface_hub/file_download.py—hf_hub_urlArgs: addendpointsrc/huggingface_hub/hf_api.py—preupload_lfs_filesArgs: renameoperations→additions, addfree_memoryVerification
make style— cleanmake quality— clean (ruff check, generated-file checks,ty check srcall 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 optionalendpoint(Hub base URL; defaults toHF_ENDPOINT), aligning withhf_hub_download/snapshot_downloaddocs from earlier PRs.HfApi.preupload_lfs_files— Args now useadditionsinstead of the incorrectoperationsname, and documentfree_memory(defaultTrue: clearspath_or_fileobjon eachCommitOperationAddafter 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.