Skip to content

Missing files when downloading subdirectory via huggingface-cli download #3552

@Raibows

Description

@Raibows

Describe the bug

Env

I'm using WSL2 Ubuntu22.04 with huggingface-hub==1.1.4.

The repo is a private model repo enabled with Xet.

Files are missing

The command I used looks like

hf download --repo-type model --token xxxx--local-dir ./ xxxxx/a-private-repo --include 'xxxxx/*'

It did not throw any errors, but I found many files and subdirectories are missing.

I also tried rm -rf ~/.cache/huggingface/hub/models--xxxx--a-private-repo but still cannot download those files and subdirectories.

Git works well

However, the following git command works well

git clone --filter=blob:none --no-checkout https://xxxxxxx
cd <repo>
git sparse-checkout init --cone
git sparse-checkout set path/to/subdir/xxxxxx
git checkout main

Please let me know how to provide more useful information to help and I cannot make this repo public since it has many sensitive information.

Reproduction


Logs

I set the HF_DEBUG=1, however, it does not print more logs.


Fetching 864 files: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████| 864/864 [00:00<00:00, 1027.44it/s]
Download complete: : 0.00B [00:00, ?B/s]              /tmp█████████████████████████████████████████████████████████████████████████▎   | 835/864 [00:00<00:00, 1005.63it/s]
Download complete: : 0.00B [00:00, ?B/s]

System info

- huggingface_hub version: 1.1.4
- Platform: Linux-6.6.87.2-microsoft-standard-WSL2-x86_64-with-glibc2.35
- Python version: 3.10.18
- Running in iPython ?: No
- Running in notebook ?: No
- Running in Google Colab ?: No
- Running in Google Colab Enterprise ?: No
- Token path ?: /home/XXXXX/.cache/huggingface/token
- Has saved token ?: True
- Who am I ?: XXXXX
- Configured git credential helpers: cache
- Installation method: unknown
- httpx: 0.28.1
- hf_xet: 1.2.0
- gradio: N/A
- tensorboard: N/A
- ENDPOINT: https://huggingface.co
- HF_HUB_CACHE: /home/XXXX/.cache/huggingface/hub
- HF_ASSETS_CACHE: /home/XXXX/.cache/huggingface/assets
- HF_TOKEN_PATH: /home/XXXX/.cache/huggingface/token
- HF_STORED_TOKENS_PATH: /home/XXXX/.cache/huggingface/stored_tokens
- HF_HUB_OFFLINE: False
- HF_HUB_DISABLE_TELEMETRY: False
- HF_HUB_DISABLE_PROGRESS_BARS: None
- HF_HUB_DISABLE_SYMLINKS_WARNING: False
- HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False
- HF_HUB_DISABLE_IMPLICIT_TOKEN: False
- HF_HUB_DISABLE_XET: False
- HF_HUB_ETAG_TIMEOUT: 10
- HF_HUB_DOWNLOAD_TIMEOUT: 10
- HF_XET_HIGH_PERFORMANCE: False

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions