Skip to content

Remove deprecated local_dir_use_symlinks from snapshot_download call#78

Open
lonexreb wants to merge 1 commit intoNVlabs:mainfrom
lonexreb:fix/download-pai-deprecated-symlinks-arg
Open

Remove deprecated local_dir_use_symlinks from snapshot_download call#78
lonexreb wants to merge 1 commit intoNVlabs:mainfrom
lonexreb:fix/download-pai-deprecated-symlinks-arg

Conversation

@lonexreb
Copy link
Copy Markdown
Contributor

@lonexreb lonexreb commented May 3, 2026

Summary

scripts/download_pai.py passes local_dir_use_symlinks=False to huggingface_hub.snapshot_download. This argument was deprecated in huggingface_hub 0.21 (Feb 2024) and removed in 0.34+, where the call now raises TypeError.

The repo's transitive dependency stack pushes huggingface_hub past the deprecation already (transformers==4.57.1 requires huggingface_hub >= 0.30), so users see a deprecation warning today and will see an outright failure as soon as their environment moves to a newer huggingface_hub.

Why redundant

When local_dir is provided, snapshot_download always copies/writes files directly into that directory (no symlink indirection through the cache). That's the same behavior the now-removed local_dir_use_symlinks=False used to request. Dropping the argument is a no-op for the desired user experience.

Diff

+    # `local_dir_use_symlinks` was deprecated in huggingface_hub 0.21 and
+    # removed in 0.34+; passing it raises TypeError on modern versions. The
+    # current behavior (no symlinks; files are copied/written into local_dir)
+    # is the only option when `local_dir` is provided, so the argument is
+    # redundant — drop it.
     downloaded_path = snapshot_download(
         repo_id=DEFAULT_REPO_ID,
         repo_type="dataset",
         local_dir=str(args.output_dir),
-        local_dir_use_symlinks=False,
         allow_patterns=allow_patterns,
     )

Test plan

  • Syntax: ast.parse(open('scripts/download_pai.py').read()) passes.
  • No behavior change with the currently installed huggingface_hub: local_dir semantics already produce real files, not symlinks.
  • Reviewer: optional — run python scripts/download_pai.py --chunk-ids 0-1 --camera camera_front_wide_120fov --calibration camera_intrinsics --labels egomotion against a recent huggingface_hub install and confirm files land under nvidia/PhysicalAI-Autonomous-Vehicles/.

References

scripts/download_pai.py passes local_dir_use_symlinks=False to
huggingface_hub.snapshot_download. This argument was deprecated in
huggingface_hub 0.21 (Feb 2024) and removed entirely in 0.34+, where
calling it raises TypeError. The repo's transitive dep stack (transformers
4.57.1 requires huggingface_hub >= 0.30) is past the deprecation but
not yet at removal — so the script currently warns and will fail outright
when users upgrade.

The argument has been redundant for years: when local_dir is provided,
files are always copied/written into the directory directly (no symlink
indirection through the cache), which is the same as what
local_dir_use_symlinks=False used to request. Drop the argument.

Signed-off-by: lonexreb <[email protected]>
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.

1 participant