Skip to content

Error downloading from Xet repository in Zero GPU Space #415

@jsulz

Description

@jsulz

I encountered a similar situation in Hugging Face's Gradio Zero GPU space, so I am reporting it just in case. I tried to reproduce the issue with the minimum configuration, but I was unable to reproduce it with just hf_hub_download. There must be some prerequisites, but I have not been able to identify them. The details of the situation are unclear.
I am attaching the log with the HF_DEBUG environment variable enabled.

Actual repo (dedicated for Zero GPU)

https://huggingface.co/spaces/John6666/DiffuseCraftDetailfixTest (Only when Detailfix is enabled)

Related code

https://github.com/R3gm/stablepy/blob/main/stablepy/diffusers_vanilla/adetailer.py#L45

Libraries

hf_transfer               0.1.9
hf-xet                    1.1.5
httpcore                  1.0.9
httpx                     0.28.1
huggingface-hub           0.33.2

When HF_HUB_DISABLE_XET == "0"

[DEBUG] >> detailfix inpaint only
Send: curl -X HEAD -H 'Accept: */*' -H 'Accept-Encoding: identity' -H 'Connection: keep-alive' -H 'user-agent: unknown/None; hf_hub/0.33.2; python/3.10.13; torch/2.2.0' https://huggingface.co/Bingsu/adetailer/resolve/main/face_yolov8n.pt
Request 70440b92-03c0-42f3-896f-7696aaeacb1f: HEAD https://huggingface.co/Bingsu/adetailer/resolve/main/face_yolov8n.pt (authenticated: False)
Downloading 'face_yolov8n.pt' to '/home/user/cache/huggingface/hub/models--Bingsu--adetailer/blobs/70b640f8f60b1cf0dcc72f30caf3da9495eb2fb6509da48c53374ad6806e6a9c.incomplete'
Xet Storage is enabled for this repo. Downloading file from Xet Storage..
Send: curl -X GET -H 'Accept: */*' -H 'Accept-Encoding: gzip, deflate' -H 'Connection: keep-alive' -H 'user-agent: unknown/None; hf_hub/0.33.2; python/3.10.13; torch/2.2.0' https://huggingface.co/api/models/Bingsu/adetailer/xet-read-token/53cc19de382014514d9d4038601d261a7faa9b7b
Request d53d9b7a-d435-4bbb-9b09-0503a49ff176: GET https://huggingface.co/api/models/Bingsu/adetailer/xet-read-token/53cc19de382014514d9d4038601d261a7faa9b7b (authenticated: False)

face_yolov8n.pt:   0%|          | 0.00/6.23M [00:00<?, ?B/s]Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/gradio/queueing.py", line 567, in process_events
    response = await route_utils.call_process_api(
  File "/usr/local/lib/python3.10/site-packages/gradio/route_utils.py", line 270, in call_process_api
    output = await app.get_blocks().process_api(
  File "/usr/local/lib/python3.10/site-packages/gradio/blocks.py", line 1908, in process_api
    result = await self.call_function(
  File "/usr/local/lib/python3.10/site-packages/gradio/blocks.py", line 1497, in call_function
    prediction = await utils.async_iteration(iterator)
  File "/usr/local/lib/python3.10/site-packages/gradio/utils.py", line 632, in async_iteration
    return await iterator.__anext__()
  File "/usr/local/lib/python3.10/site-packages/gradio/utils.py", line 625, in __anext__
    return await anyio.to_thread.run_sync(
  File "/usr/local/lib/python3.10/site-packages/anyio/to_thread.py", line 56, in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
  File "/usr/local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 2470, in run_sync_in_worker_thread
    return await future
  File "/usr/local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 967, in run
    result = context.run(func, *args)
  File "/usr/local/lib/python3.10/site-packages/gradio/utils.py", line 608, in run_sync_iterator_async
    return next(iterator)
  File "/usr/local/lib/python3.10/site-packages/gradio/utils.py", line 791, in gen_wrapper
    response = next(iterator)
  File "/home/user/app/app.py", line 682, in sd_gen_generate_pipeline
    yield from dynamic_gpu_duration(
  File "/usr/local/lib/python3.10/site-packages/spaces/zero/wrappers.py", line 353, in gradio_handler
    raise error("ZeroGPU worker error", "GPU task aborted")
gradio.exceptions.Error: 'GPU task aborted'

When HF_HUB_DISABLE_XET == "1" (or huggingface-hub==0.29.3)

[DEBUG] >> detailfix inpaint only
Send: curl -X HEAD -H 'Accept: */*' -H 'Accept-Encoding: identity' -H 'Connection: keep-alive' -H 'user-agent: unknown/None; hf_hub/0.33.2; python/3.10.13; torch/2.2.0' https://huggingface.co/Bingsu/adetailer/resolve/main/face_yolov8n.pt
Request da5c7eeb-cde3-4591-8fb3-1ec56b34cdf8: HEAD https://huggingface.co/Bingsu/adetailer/resolve/main/face_yolov8n.pt (authenticated: False)
Downloading 'face_yolov8n.pt' to '/home/user/cache/huggingface/hub/models--Bingsu--adetailer/blobs/70b640f8f60b1cf0dcc72f30caf3da9495eb2fb6509da48c53374ad6806e6a9c.incomplete'
Xet Storage is enabled for this repo, but the 'hf_xet' package is not installed. Falling back to regular HTTP download. For better performance, install the package with: `pip install huggingface_hub[hf_xet]` or `pip install hf_xet`
Send: curl -X GET -H 'Accept: */*' -H 'Accept-Encoding: gzip, deflate' -H 'Connection: keep-alive' -H 'user-agent: unknown/None; hf_hub/0.33.2; python/3.10.13; torch/2.2.0' https://huggingface.co/Bingsu/adetailer/resolve/main/face_yolov8n.pt
Request fc4a1bcd-edc3-4be7-8a81-5e677d3d066f: GET https://huggingface.co/Bingsu/adetailer/resolve/main/face_yolov8n.pt (authenticated: False)
Send: curl -X GET -H 'Accept: */*' -H 'Accept-Encoding: gzip, deflate' -H 'Connection: keep-alive' -H 'X-Amzn-Trace-Id: fc4a1bcd-edc3-4be7-8a81-5e677d3d066f' -H 'user-agent: unknown/None; hf_hub/0.33.2; python/3.10.13; torch/2.2.0' 'https://cas-bridge-direct.xethub.hf.co/xet-bridge-us/644877453e498d66919f36ec/d1126adb762a2a935e6a9780395360ba6a223144ee012777342d4258180c3e93?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=cas%2F20250715%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250715T120811Z&X-Amz-Expires=3600&X-Amz-Signature=aa51962afa1a10267fe3cebb4cdc094e25f7b084fc45301118293c44ed5a2aea&X-Amz-SignedHeaders=host&X-Xet-Cas-Uid=public&response-content-disposition=inline%3B%20filename%2A%3DUTF-8%27%27face_yolov8n.pt%3B%20filename%3D%22face_yolov8n.pt%22%3B&x-id=GetObject'
Request fc4a1bcd-edc3-4be7-8a81-5e677d3d066f: GET https://cas-bridge-direct.xethub.hf.co/xet-bridge-us/644877453e498d66919f36ec/d1126adb762a2a935e6a9780395360ba6a223144ee012777342d4258180c3e93?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=cas%2F20250715%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250715T120811Z&X-Amz-Expires=3600&X-Amz-Signature=aa51962afa1a10267fe3cebb4cdc094e25f7b084fc45301118293c44ed5a2aea&X-Amz-SignedHeaders=host&X-Xet-Cas-Uid=public&response-content-disposition=inline%3B%20filename%2A%3DUTF-8%27%27face_yolov8n.pt%3B%20filename%3D%22face_yolov8n.pt%22%3B&x-id=GetObject (authenticated: False)

face_yolov8n.pt:   0%|          | 0.00/6.23M [00:00<?, ?B/s]
face_yolov8n.pt: 100%|██████████| 6.23M/6.23M [00:00<00:00, 33.0MB/s]
Download complete. Moving file to /home/user/cache/huggingface/hub/models--Bingsu--adetailer/blobs/70b640f8f60b1cf0dcc72f30caf3da9495eb2fb6509da48c53374ad6806e6a9c
Creating pointer from ../../blobs/70b640f8f60b1cf0dcc72f30caf3da9495eb2fb6509da48c53374ad6806e6a9c to /home/user/cache/huggingface/hub/models--Bingsu--adetailer/snapshots/53cc19de382014514d9d4038601d261a7faa9b7b/face_yolov8n.pt
[INFO] >> No object detected on 1 image with face_yolov8n.pt detector.
[INFO] >> DetailFix: No detections found in image. Returning original image
[INFO] >> Seeds: [775466752]
[INFO] >> ['./images/00001_stable-diffusion-xl-base-1.0_775466752.png']

Originally posted by @John6666cat in #407

Metadata

Metadata

Assignees

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