Skip to content

huggingface-cli[hf_xet] error and low download speed (on slow residential connection) #3036

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
aa956 opened this issue Apr 29, 2025 · 8 comments
Labels
bug Something isn't working

Comments

@aa956
Copy link

aa956 commented Apr 29, 2025

Describe the bug

Tried the hf_xet today for the first time:

  1. Installed huggingface-cli including hf_xet as uv tool.
  2. Tried to download the model and got the error message:

RuntimeError: Data processing error: CAS service error : Error : single flight error: Real call failed: CasObjectError(InternalIOError(Custom { kind: Other, error: reqwest::Error { kind: Decode, source: hyper::Error(Body, Custom { kind: UnexpectedEof, error: IncompleteBody }) } }))

Notes:

  • debian 12 desktop machine
  • --max-workers=1 is used as (residential) network connection is very slow (100Mbps down / 20Mbps up) so there's a need to somehow limit the download rate for other devices on the network to be usable.
  • Usual download speed with --max-workers=1 without hf_xet installed was about 10MB/s, with hf_xet is ca 7MB/s. Start of the download was slow too.
  • HF_HOME points to ntfs volume:
aa956@desktop02:~$ set | grep HF
HF_HOME=/mnt/e/cache/huggingface/
aa956@desktop02:~$ mount | grep /mnt/e
/dev/nvme1n1p2 on /mnt/e type fuseblk (rw,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)
aa956@desktop02:~$

Reproduction

$ wget -qO- https://astral.sh/uv/install.sh | sh
$ uv tool install huggingface-hub[hf_xet]
$ huggingface-cli download --max-workers 1 bartowski/THUDM_GLM-Z1-32B-0414-GGUF --include "*Q4_K_L*"

Logs

First run:


aa956@desktop02:~$ huggingface-cli download --max-workers 1 bartowski/THUDM_GLM-Z1-32B-0414-GGUF --include "*Q4_K_L*" && huggingface-cli download --max-workers 1 bartowski/THUDM_GLM-4-32B-0414-GGUF --include "*Q4_K_L*"
Fetching 1 files:   0%|                                                                        | 0/1 [00:00<?, ?it/s]Downloading 'THUDM_GLM-Z1-32B-0414-Q4_K_L.gguf' to '/mnt/e/cache/huggingface/hub/models--bartowski--THUDM_GLM-Z1-32B-0414-GGUF/blobs/aa976549c95417e1418ae8aaa4deb741fbb4b5fb6f525bfae2c430b787ac7357.incomplete'
Xet Storage is enabled for this repo. Downloading file from Xet Storage..
THUDM_GLM-Z1-32B-0414-Q4_K_L.gguf:  42%|████████████████▋                       | 8.47G/20.4G [20:05<28:12, 7.03MB/s]
Fetching 1 files:   0%|                                                                        | 0/1 [20:05<?, ?it/s]
Traceback (most recent call last):
  File "/home/aa956/.local/bin/huggingface-cli", line 10, in <module>
    sys.exit(main())
             ~~~~^^
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/huggingface_hub/commands/huggingface_cli.py", line 57, in main
    service.run()
    ~~~~~~~~~~~^^
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/huggingface_hub/commands/download.py", line 153, in run
    print(self._download())  # Print path to downloaded files
          ~~~~~~~~~~~~~~^^
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/huggingface_hub/commands/download.py", line 187, in _download
    return snapshot_download(
        repo_id=self.repo_id,
    ...<10 lines>...
        max_workers=self.max_workers,
    )
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
    return fn(*args, **kwargs)
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/huggingface_hub/_snapshot_download.py", line 296, in snapshot_download
    thread_map(
    ~~~~~~~~~~^
        _inner_hf_hub_download,
        ^^^^^^^^^^^^^^^^^^^^^^^
    ...<4 lines>...
        tqdm_class=tqdm_class or hf_tqdm,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/tqdm/contrib/concurrent.py", line 69, in thread_map
    return _executor_map(ThreadPoolExecutor, fn, *iterables, **tqdm_kwargs)
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/tqdm/contrib/concurrent.py", line 51, in _executor_map
    return list(tqdm_class(ex.map(fn, *iterables, chunksize=chunksize), **kwargs))
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/tqdm/std.py", line 1181, in __iter__
    for obj in iterable:
               ^^^^^^^^
  File "/home/aa956/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/lib/python3.13/concurrent/futures/_base.py", line 619, in result_iterator
    yield _result_or_cancel(fs.pop())
          ~~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/home/aa956/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/lib/python3.13/concurrent/futures/_base.py", line 317, in _result_or_cancel
    return fut.result(timeout)
           ~~~~~~~~~~^^^^^^^^^
  File "/home/aa956/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/lib/python3.13/concurrent/futures/_base.py", line 456, in result
    return self.__get_result()
           ~~~~~~~~~~~~~~~~~^^
  File "/home/aa956/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/lib/python3.13/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/home/aa956/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/lib/python3.13/concurrent/futures/thread.py", line 59, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/huggingface_hub/_snapshot_download.py", line 270, in _inner_hf_hub_download
    return hf_hub_download(
        repo_id,
    ...<15 lines>...
        headers=headers,
    )
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
    return fn(*args, **kwargs)
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/huggingface_hub/file_download.py", line 961, in hf_hub_download
    return _hf_hub_download_to_cache_dir(
        # Destination
    ...<14 lines>...
        force_download=force_download,
    )
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/huggingface_hub/file_download.py", line 1112, in _hf_hub_download_to_cache_dir
    _download_to_tmp_and_move(
    ~~~~~~~~~~~~~~~~~~~~~~~~~^
        incomplete_path=Path(blob_path + ".incomplete"),
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<8 lines>...
        xet_file_data=xet_file_data,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/huggingface_hub/file_download.py", line 1661, in _download_to_tmp_and_move
    xet_get(
    ~~~~~~~^
        incomplete_path=incomplete_path,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<3 lines>...
        displayed_filename=filename,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/huggingface_hub/file_download.py", line 580, in xet_get
    download_files(
    ~~~~~~~~~~~~~~^
        pointer_files,
        ^^^^^^^^^^^^^^
    ...<3 lines>...
        progress_updater=[progress_updater],
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
RuntimeError: Data processing error: CAS service error : Error : single flight error: Real call failed: CasObjectError(InternalIOError(Custom { kind: Other, error: reqwest::Error { kind: Decode, source: hyper::Error(Body, Custom { kind: UnexpectedEof, error: IncompleteBody }) } }))
aa956@desktop02:~$


Second run:


aa956@desktop02:~$ HF_DEBUG=1 huggingface-cli download --max-workers 1 bartowski/THUDM_GLM-Z1-32B-0414-GGUF --include "*Q4_K_L*" && HF_DEBUG=1 huggingface-cli download --max-workers 1 bartowski/THUDM_GLM-4-32B-0414-GGUF --include "*Q4_K_L*"
Fetching 1 files:   0%|                                                                        | 0/1 [00:00<?, ?it/s]Downloading 'THUDM_GLM-Z1-32B-0414-Q4_K_L.gguf' to '/mnt/e/cache/huggingface/hub/models--bartowski--THUDM_GLM-Z1-32B-0414-GGUF/blobs/aa976549c95417e1418ae8aaa4deb741fbb4b5fb6f525bfae2c430b787ac7357.incomplete' (resume from 19410731611/20371099776)
Xet Storage is enabled for this repo. Downloading file from Xet Storage..
THUDM_GLM-Z1-32B-0414-Q4_K_L.gguf:  41%|████████████████▎                       | 8.33G/20.4G [05:47<08:21, 24.0MB/s]
Fetching 1 files:   0%|                                                                        | 0/1 [05:47<?, ?it/s]
Traceback (most recent call last):
  File "/home/aa956/.local/bin/huggingface-cli", line 10, in <module>
    sys.exit(main())
             ~~~~^^
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/huggingface_hub/commands/huggingface_cli.py", line 57, in main
    service.run()
    ~~~~~~~~~~~^^
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/huggingface_hub/commands/download.py", line 153, in run
    print(self._download())  # Print path to downloaded files
          ~~~~~~~~~~~~~~^^
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/huggingface_hub/commands/download.py", line 187, in _download
    return snapshot_download(
        repo_id=self.repo_id,
    ...<10 lines>...
        max_workers=self.max_workers,
    )
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
    return fn(*args, **kwargs)
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/huggingface_hub/_snapshot_download.py", line 296, in snapshot_download
    thread_map(
    ~~~~~~~~~~^
        _inner_hf_hub_download,
        ^^^^^^^^^^^^^^^^^^^^^^^
    ...<4 lines>...
        tqdm_class=tqdm_class or hf_tqdm,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/tqdm/contrib/concurrent.py", line 69, in thread_map
    return _executor_map(ThreadPoolExecutor, fn, *iterables, **tqdm_kwargs)
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/tqdm/contrib/concurrent.py", line 51, in _executor_map
    return list(tqdm_class(ex.map(fn, *iterables, chunksize=chunksize), **kwargs))
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/tqdm/std.py", line 1181, in __iter__
    for obj in iterable:
               ^^^^^^^^
  File "/home/aa956/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/lib/python3.13/concurrent/futures/_base.py", line 619, in result_iterator
    yield _result_or_cancel(fs.pop())
          ~~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/home/aa956/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/lib/python3.13/concurrent/futures/_base.py", line 317, in _result_or_cancel
    return fut.result(timeout)
           ~~~~~~~~~~^^^^^^^^^
  File "/home/aa956/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/lib/python3.13/concurrent/futures/_base.py", line 456, in result
    return self.__get_result()
           ~~~~~~~~~~~~~~~~~^^
  File "/home/aa956/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/lib/python3.13/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/home/aa956/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/lib/python3.13/concurrent/futures/thread.py", line 59, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/huggingface_hub/_snapshot_download.py", line 270, in _inner_hf_hub_download
    return hf_hub_download(
        repo_id,
    ...<15 lines>...
        headers=headers,
    )
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
    return fn(*args, **kwargs)
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/huggingface_hub/file_download.py", line 961, in hf_hub_download
    return _hf_hub_download_to_cache_dir(
        # Destination
    ...<14 lines>...
        force_download=force_download,
    )
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/huggingface_hub/file_download.py", line 1112, in _hf_hub_download_to_cache_dir
    _download_to_tmp_and_move(
    ~~~~~~~~~~~~~~~~~~~~~~~~~^
        incomplete_path=Path(blob_path + ".incomplete"),
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<8 lines>...
        xet_file_data=xet_file_data,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/huggingface_hub/file_download.py", line 1661, in _download_to_tmp_and_move
    xet_get(
    ~~~~~~~^
        incomplete_path=incomplete_path,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<3 lines>...
        displayed_filename=filename,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/huggingface_hub/file_download.py", line 580, in xet_get
    download_files(
    ~~~~~~~~~~~~~~^
        pointer_files,
        ^^^^^^^^^^^^^^
    ...<3 lines>...
        progress_updater=[progress_updater],
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
RuntimeError: Data processing error: CAS service error : Error : single flight error: Real call failed: CasObjectError(InternalIOError(Custom { kind: Other, error: reqwest::Error { kind: Decode, source: hyper::Error(Body, Os { code: 104, kind: ConnectionReset, message: "Connection reset by peer" }) } }))
aa956@desktop02:~$

System info

- huggingface_hub version: 0.30.2
- Platform: Linux-6.1.0-34-amd64-x86_64-with-glibc2.36
- Python version: 3.13.1
- Running in iPython ?: No
- Running in notebook ?: No
- Running in Google Colab ?: No
- Running in Google Colab Enterprise ?: No
- Token path ?: /mnt/e/cache/huggingface/token
- Has saved token ?: True
- Who am I ?: **redacted**
- Configured git credential helpers:
- FastAI: N/A
- Tensorflow: N/A
- Torch: N/A
- Jinja2: N/A
- Graphviz: N/A
- keras: N/A
- Pydot: N/A
- Pillow: N/A
- hf_transfer: N/A
- gradio: N/A
- tensorboard: N/A
- numpy: N/A
- pydantic: N/A
- aiohttp: N/A
- hf_xet: 1.0.5
- ENDPOINT: https://huggingface.co
- HF_HUB_CACHE: /mnt/e/cache/huggingface/hub
- HF_ASSETS_CACHE: /mnt/e/cache/huggingface/assets
- HF_TOKEN_PATH: /mnt/e/cache/huggingface/token
- HF_STORED_TOKENS_PATH: /mnt/e/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_ENABLE_HF_TRANSFER: False
- HF_HUB_ETAG_TIMEOUT: 10
- HF_HUB_DOWNLOAD_TIMEOUT: 10
@aa956 aa956 added the bug Something isn't working label Apr 29, 2025
@aa956
Copy link
Author

aa956 commented Apr 29, 2025

Third try, same location, new error:

RuntimeError: Data processing error: CAS service error : Error : single flight error: Real call failed: ReqwestMiddlewareError(Reqwest(reqwest::Error { kind: Request, url: "https://transfer.xethub.hf.co/xorbs/default/c8516907a39cb2e83a214838512a23a3051da712e74ab376b2d551d9a87dda71?X-Xet-Signed-Range=bytes%3D0-67096169&Expires=1745913842&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly90cmFuc2Zlci54ZXRodWIuaGYuY28veG9yYnMvZGVmYXVsdC9jODUxNjkwN2EzOWNiMmU4M2EyMTQ4Mzg1MTJhMjNhMzA1MWRhNzEyZTc0YWIzNzZiMmQ1NTFkOWE4N2RkYTcxP1gtWGV0LVNpZ25lZC1SYW5nZT1ieXRlcyUzRDAtNjcwOTYxNjkiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjE3NDU5MTM4NDJ9fX1dfQ__&Signature=WX97-6o5Dys75vzKhXLRu~OOxCpmihieRhycGDErhsEx1bLUKhWhecY2H-rnwhcz3cMRDBkv8K2wSxugR5aqN74o1vY8406bwaGYr5tK3bUUyxzV-CZ0h1M8I-0Vbz3iL3WO37xXERGNh38aC~59T47TnJsLexMmFTsF8nlC5EexHYncPWfPASk-i8etcEw5GLRyS3wnY~ovhdkMC~DkkOkC7je4-PPRB2VgowD0mNWBVMjjg45hv-FxXqpNiB1bzYWZ2PNN-6fan7zmHzKmqussyXhGdymDw8664TCbw~r-Pmi45GaN6HdesyWWTBcgoCbaxD7aXpbO57EmSix1vg__&Key-Pair-Id=K2L8F4GPSG1IFC", source: hyper_util::client::legacy::Error(SendRequest, hyper::Error(ChannelClosed)) }))

@hanouticelina
Copy link
Contributor

Hi @aa956,
Apologies for the inconvenience. we're currently investigating the issue internally. In the meantime, could you please try setting the environment variable HF_XET_NUM_CONCURRENT_RANGE_GETS to different values lower than 16 and see if that helps?

thank you!

@aa956
Copy link
Author

aa956 commented Apr 29, 2025

No problem, it's not critical at all, just downloading some models and decided to try new hf_xet method.

Looks like download continued for some time with HF_XET_NUM_CONCURRENT_RANGE_GETS=4 but then errored again
with source: hyper::Error(Body, Custom { kind: UnexpectedEof, error: IncompleteBody }):

aa956@desktop02:~$ HF_XET_NUM_CONCURRENT_RANGE_GETS=4 huggingface-cli download --max-workers 1 bartowski/THUDM_GLM-Z1-32B-0414-GGUF --include "*Q4_K_L*"
Fetching 1 files:   0%|                                                                        | 0/1 [00:00<?, ?it/s]Downloading 'THUDM_GLM-Z1-32B-0414-Q4_K_L.gguf' to '/mnt/e/cache/huggingface/hub/models--bartowski--THUDM_GLM-Z1-32B-0414-GGUF/blobs/aa976549c95417e1418ae8aaa4deb741fbb4b5fb6f525bfae2c430b787ac7357.incomplete' (resume from 20096519115/20371099776)
Xet Storage is enabled for this repo. Downloading file from Xet Storage..
THUDM_GLM-Z1-32B-0414-Q4_K_L.gguf:  41%|████████████████▌                       | 8.42G/20.4G [07:56<11:16, 17.7MB/s]
Fetching 1 files:   0%|                                                                        | 0/1 [07:56<?, ?it/s]
Traceback (most recent call last):
  File "/home/aa956/.local/bin/huggingface-cli", line 10, in <module>
    sys.exit(main())
             ~~~~^^
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/huggingface_hub/commands/huggingface_cli.py", line 57, in main
    service.run()
    ~~~~~~~~~~~^^
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/huggingface_hub/commands/download.py", line 153, in run
    print(self._download())  # Print path to downloaded files
          ~~~~~~~~~~~~~~^^
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/huggingface_hub/commands/download.py", line 187, in _download
    return snapshot_download(
        repo_id=self.repo_id,
    ...<10 lines>...
        max_workers=self.max_workers,
    )
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
    return fn(*args, **kwargs)
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/huggingface_hub/_snapshot_download.py", line 296, in snapshot_download
    thread_map(
    ~~~~~~~~~~^
        _inner_hf_hub_download,
        ^^^^^^^^^^^^^^^^^^^^^^^
    ...<4 lines>...
        tqdm_class=tqdm_class or hf_tqdm,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/tqdm/contrib/concurrent.py", line 69, in thread_map
    return _executor_map(ThreadPoolExecutor, fn, *iterables, **tqdm_kwargs)
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/tqdm/contrib/concurrent.py", line 51, in _executor_map
    return list(tqdm_class(ex.map(fn, *iterables, chunksize=chunksize), **kwargs))
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/tqdm/std.py", line 1181, in __iter__
    for obj in iterable:
               ^^^^^^^^
  File "/home/aa956/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/lib/python3.13/concurrent/futures/_base.py", line 619, in result_iterator
    yield _result_or_cancel(fs.pop())
          ~~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/home/aa956/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/lib/python3.13/concurrent/futures/_base.py", line 317, in _result_or_cancel
    return fut.result(timeout)
           ~~~~~~~~~~^^^^^^^^^
  File "/home/aa956/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/lib/python3.13/concurrent/futures/_base.py", line 456, in result
    return self.__get_result()
           ~~~~~~~~~~~~~~~~~^^
  File "/home/aa956/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/lib/python3.13/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/home/aa956/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/lib/python3.13/concurrent/futures/thread.py", line 59, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/huggingface_hub/_snapshot_download.py", line 270, in _inner_hf_hub_download
    return hf_hub_download(
        repo_id,
    ...<15 lines>...
        headers=headers,
    )
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
    return fn(*args, **kwargs)
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/huggingface_hub/file_download.py", line 961, in hf_hub_download
    return _hf_hub_download_to_cache_dir(
        # Destination
    ...<14 lines>...
        force_download=force_download,
    )
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/huggingface_hub/file_download.py", line 1112, in _hf_hub_download_to_cache_dir
    _download_to_tmp_and_move(
    ~~~~~~~~~~~~~~~~~~~~~~~~~^
        incomplete_path=Path(blob_path + ".incomplete"),
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<8 lines>...
        xet_file_data=xet_file_data,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/huggingface_hub/file_download.py", line 1661, in _download_to_tmp_and_move
    xet_get(
    ~~~~~~~^
        incomplete_path=incomplete_path,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<3 lines>...
        displayed_filename=filename,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/huggingface_hub/file_download.py", line 580, in xet_get
    download_files(
    ~~~~~~~~~~~~~~^
        pointer_files,
        ^^^^^^^^^^^^^^
    ...<3 lines>...
        progress_updater=[progress_updater],
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
RuntimeError: Data processing error: CAS service error : Error : single flight error: Real call failed: CasObjectError(InternalIOError(Custom { kind: Other, error: reqwest::Error { kind: Decode, source: hyper::Error(Body, Custom { kind: UnexpectedEof, error: IncompleteBody }) } }))
aa956@desktop02:~$

@aa956
Copy link
Author

aa956 commented Apr 29, 2025

HF_XET_NUM_CONCURRENT_RANGE_GETS=2 ended with Connection reset by peer:

RuntimeError: Data processing error: CAS service error : Error : single flight error: Real call failed: CasObjectError(InternalIOError(Custom { kind: Other, error: reqwest::Error { kind: Decode, source: hyper::Error(Body, Os { code: 104, kind: ConnectionReset, message: "Connection reset by peer" }) } }))

For the next try I'll remove --max-workers 1 from the command line

@aa956
Copy link
Author

aa956 commented Apr 29, 2025

Values 2, 4, 8 tried for HF_XET_NUM_CONCURRENT_RANGE_GETS, results are very similar:

$ HF_XET_NUM_CONCURRENT_RANGE_GETS=8 huggingface-cli download bartowski/THUDM_GLM-Z1-32B-0414-GGUF --include "*Q4_K_L*"
[62/62]Fetching 1 files:   0%|                                                                                                                             | 0/1 [00:00<?, ?it/s]
Downloading 'THUDM_GLM-Z1-32B-0414-Q4_K_L.gguf' to '/mnt/e/cache/huggingface/hub/models--bartowski--THUDM_GLM-Z1-32B-0414-GGUF/blobs/aa976549c95417e1418ae8aaa4deb741fbb4$5fb6f525bfae2c430b787ac7357.incomplete' (resume from 20096519115/20371099776)
Xet Storage is enabled for this repo. Downloading file from Xet Storage..
THUDM_GLM-Z1-32B-0414-Q4_K_L.gguf:  42%|██████████████████████████████████████▉                                                      | 8.54G/20.4G [06:07<08:28, 23.3MB/s]
Fetching 1 files:   0%|                                                                                                                             | 0/1 [06:07<?, ?it/s]
Traceback (most recent call last):

... same location as previous logs ...


RuntimeError: Data processing error: CAS service error : Error : single flight error: Real call failed: CasObjectError(InternalIOError(Custom { kind: Other, error: reqwest::Error { kind: Decode, source: hyper::Error(Body, Os { code: 104, kind: ConnectionReset, message: "Connection reset by peer" }) } }))
$

@NanoCode012
Copy link

I used to get this issue when initially testing xet. In my case, I downloaded a model midway with HTTP then swapped to XET. Deleting the cache dir solved it for me.

@aa956
Copy link
Author

aa956 commented May 1, 2025

Cleared caches, reinstalled huggingface-hub[hf_xet], retried the download.

I see that hf_xet is now at version 1.1.0.

Still fails but log shows that one of the errors was handled by retrying:

$ uv tool uninstall huggingface-hub
$ rm -rf $HF_HOME/hub/.locks/models--bartowski--THUDM_GLM-Z1-32B-0414-GGUF
$ rm -rf $HF_HOME/hub/models--bartowski--THUDM_GLM-Z1-32B-0414-GGUF
$ rm -rf $HF_HOME/xet
$ uv tool install huggingface-hub[hf_xet]
$ HF_DEBUG=1 huggingface-cli download bartowski/THUDM_GLM-Z1-32B-0414-GGUF --include "*Q4_K_L*"
Fetching 1 files:   0%|      | 0/1 [00:00<?, ?it/s]
Downloading 'THUDM_GLM-Z1-32B-0414-Q4_K_L.gguf' to '/mnt/e/cache/huggingface/hub/models--bartowski--THUDM_GLM-Z1-32B-0414-GGUF/blobs/3e9358b3f18ee5943ce43069a477cf3bc5ad998a0cf4a02654452bc852d20524.incomplete'
Xet Storage is enabled for this repo. Downloading file from Xet Storage..
THUDM_GLM-Z1-32B-0414-Q4_K_L.gguf:  27%|███          | 5.40G/20.4G [13:09<1:22:36, 3.02MB/s]
"timestamp":"2025-05-01T06:12:24.182669Z","level":"WARN","fields":{"message":"Reqwest(reqwest::Error { kind: Request, url: \"https://transfer.xethub.hf.co/xorbs/default/c742d154a2b697560c260af6ad28ff30bbbe68ae9e123df6cf310fe2ad6f47d5?X-Xet-Signed-Range=bytes%3D0-67099508&Expires=1746083194&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly90cmFuc2Zlci54ZXRodWIuaGYuY28veG9yYnMvZGVmYXVsdC9jNzQyZDE1NGEyYjY5NzU2MGMyNjBhZjZhZDI4ZmYzMGJiYmU2OGFlOWUxMjNkZjZjZjMxMGZlMmFkNmY0N2Q1P1gtWGV0LVNpZ25lZC1SYW5nZT1ieXRlcyUzRDAtNjcwOTk1MDgiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjE3NDYwODMxOTR9fX1dfQ__&Signature=SYMvTTV-u2Uawi~7GtVKa8qL7-v5p40PNqgm-XyePmaF5ZWHWrbRf-R4nA95CvKksAZlhcPRtK4RcPtYJkUZJ3BM2bnDNNWQhhRn5sK93cXdidn1GMhYz7dO1Zl3Zmta-gtOBQH45P49gRDmN7oTqW3A34DWtS13hUzEI~cR9qK3SJM46Ob5Vf2H1VAY8Ehz7EtNcKi7UQMsbbSPy5R6xXiazNDbe6l5HrUxNjt3VbSec52T6qcQhrqMpxu~F8~NP3dhxs5-H1M9WE07u2gG9OSiDLd9zACuI2JoGQwISw8kbdGpnLzNH4M~g~mUW9QwmjtzzzbbAHFb3xb9t-SM8g__&Key-Pair-Id=K2L8F4GPSG1IFC\", source: hyper_util::client::legacy::Error(SendRequest, hyper::Error(IncompleteMessage)) }). Retrying..."},"filename":"/home/runner/work/xet-core/xet-core/cas_client/src/http_client.rs","line_number":164}
{"timestamp":"2025-05-01T06:12:24.182694Z","level":"WARN","fields":{"message":"Retry attempt #0. Sleeping 2.440166319s before the next attempt"},"filename":"/root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/reqwest-retry-0.6.1/src/middleware.rs","line_number":166}
THUDM_GLM-Z1-32B-0414-Q4_K_L.gguf:  49%|████████▎      | 10.0G/20.4G [22:05<22:50, 7.56MB/s]
Fetching 1 files:   0%|                                | 0/1 [22:06<?, ?it/s]
Traceback (most recent call last):
  File "/home/aa956/.local/bin/huggingface-cli", line 10, in <module>
    sys.exit(main())
             ~~~~^^
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/huggingface_hub/commands/huggingface_cli.py", line 57, in main
    service.run()
    ~~~~~~~~~~~^^
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/huggingface_hub/commands/download.py", line 153, in run
    print(self._download())  # Print path to downloaded files
          ~~~~~~~~~~~~~~^^
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/huggingface_hub/commands/download.py", line 187, in _download
    return snapshot_download(
        repo_id=self.repo_id,
    ...<10 lines>...
        max_workers=self.max_workers,
    )
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
    return fn(*args, **kwargs)
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/huggingface_hub/_snapshot_download.py", line 296, in snapshot_download
    thread_map(
    ~~~~~~~~~~^
        _inner_hf_hub_download,
        ^^^^^^^^^^^^^^^^^^^^^^^
    ...<4 lines>...
        tqdm_class=tqdm_class or hf_tqdm,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/tqdm/contrib/concurrent.py", line 69, in thread_map
    return _executor_map(ThreadPoolExecutor, fn, *iterables, **tqdm_kwargs)
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/tqdm/contrib/concurrent.py", line 51, in _executor_map
    return list(tqdm_class(ex.map(fn, *iterables, chunksize=chunksize), **kwargs))
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/tqdm/std.py", line 1181, in __iter__
    for obj in iterable:
               ^^^^^^^^
  File "/home/aa956/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/lib/python3.13/concurrent/futures/_base.py", line 619, in result_iterator
    yield _result_or_cancel(fs.pop())
          ~~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/home/aa956/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/lib/python3.13/concurrent/futures/_base.py", line 317, in _result_or_cancel
    return fut.result(timeout)
           ~~~~~~~~~~^^^^^^^^^
  File "/home/aa956/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/lib/python3.13/concurrent/futures/_base.py", line 456, in result
    return self.__get_result()
           ~~~~~~~~~~~~~~~~~^^
  File "/home/aa956/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/lib/python3.13/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/home/aa956/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/lib/python3.13/concurrent/futures/thread.py", line 59, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/huggingface_hub/_snapshot_download.py", line 270, in _inner_hf_hub_download
    return hf_hub_download(
        repo_id,
    ...<15 lines>...
        headers=headers,
    )
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
    return fn(*args, **kwargs)
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/huggingface_hub/file_download.py", line 961, in hf_hub_download
    return _hf_hub_download_to_cache_dir(
        # Destination
    ...<14 lines>...
        force_download=force_download,
    )
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/huggingface_hub/file_download.py", line 1112, in _hf_hub_download_to_cache_dir
    _download_to_tmp_and_move(
    ~~~~~~~~~~~~~~~~~~~~~~~~~^
        incomplete_path=Path(blob_path + ".incomplete"),
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<8 lines>...
        xet_file_data=xet_file_data,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/huggingface_hub/file_download.py", line 1661, in _download_to_tmp_and_move
    xet_get(
    ~~~~~~~^
        incomplete_path=incomplete_path,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<3 lines>...
        displayed_filename=filename,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/home/aa956/.local/share/uv/tools/huggingface-hub/lib/python3.13/site-packages/huggingface_hub/file_download.py", line 580, in xet_get
    download_files(
    ~~~~~~~~~~~~~~^
        pointer_files,
        ^^^^^^^^^^^^^^
    ...<3 lines>...
        progress_updater=[progress_updater],
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
RuntimeError: Data processing error: CAS service error : Error : single flight error: Real call failed: CasObjectError(InternalIOError(Custom { kind: Other, error: reqwest::Error { kind: Decode, source: hyper::Error(Body, Custom { kind: UnexpectedEof, error: IncompleteBody }) } }))

@aa956
Copy link
Author

aa956 commented May 1, 2025

System info for the last log:

$ huggingface-cli env

Copy-and-paste the text below in your GitHub issue.

- huggingface_hub version: 0.30.2
- Platform: Linux-6.1.0-34-amd64-x86_64-with-glibc2.36
- Python version: 3.13.1
- Running in iPython ?: No
- Running in notebook ?: No
- Running in Google Colab ?: No
- Running in Google Colab Enterprise ?: No
- Token path ?: /mnt/e/cache/huggingface/token
- Has saved token ?: True
- Who am I ?: **redacted**
- Configured git credential helpers: 
- FastAI: N/A
- Tensorflow: N/A
- Torch: N/A
- Jinja2: N/A
- Graphviz: N/A
- keras: N/A
- Pydot: N/A
- Pillow: N/A
- hf_transfer: N/A
- gradio: N/A
- tensorboard: N/A
- numpy: N/A
- pydantic: N/A
- aiohttp: N/A
- hf_xet: 1.1.0
- ENDPOINT: https://huggingface.co
- HF_HUB_CACHE: /mnt/e/cache/huggingface/hub
- HF_ASSETS_CACHE: /mnt/e/cache/huggingface/assets
- HF_TOKEN_PATH: /mnt/e/cache/huggingface/token
- HF_STORED_TOKENS_PATH: /mnt/e/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_ENABLE_HF_TRANSFER: False
- HF_HUB_ETAG_TIMEOUT: 10
- HF_HUB_DOWNLOAD_TIMEOUT: 10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants