huggingface / huggingface/hf_transfer

Consider disabling HF_HUB_ENABLE_HF_TRANSFER for better error handling

Open
#63 30 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
580
Forks
41
Avg merge
7m
Merged PRs (30d)
1

Description

I am using this in my installers and working great for me

`set HF_HUB_ENABLE_HF_TRANSFER=1`

However some people having below error. Any way to fix it? or some auto fallback so it will still work?

```
model.ckpt: 11%|███████ | 262M/2.47G [02:29<20:58, 1.75MB/s]
Traceback (most recent call last):
File "C:\Users\ShinOnii\Downloads\GigaGAN_Upscaler_v4\venv\lib\site-packages\huggingface_hub\file_download.py", line 426, in http_get
hf_transfer.download(
Exception: Error while removing corrupted file: The process cannot access the file because it is being used by another process. (os error 32)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Users\ShinOnii\Downloads\GigaGAN_Upscaler_v4\app.py", line 41, in
aura_sr = AuraSR.from_pretrained("fal/AuraSR-v2")
File "C:\Users\ShinOnii\Downloads\GigaGAN_Upscaler_v4\venv\lib\site-packages\aura_sr.py", line 807, in from_pretrained
hf_model_path = Path(snapshot_download(model_id))
File "C:\Users\ShinOnii\Downloads\GigaGAN_Upscaler_v4\venv\lib\site-packages\huggingface_hub\utils\_validators.py", line 114, in _inner_fn
return fn(*args, **kwargs)
File "C:\Users\ShinOnii\Downloads\GigaGAN_Upscaler_v4\venv\lib\site-packages\huggingface_hub\_snapshot_download.py", line 294, in snapshot_download
_inner_hf_hub_download(file)
File "C:\Users\ShinOnii\Downloads\GigaGAN_Upscaler_v4\venv\lib\site-packages\huggingface_hub\_snapshot_download.py", line 270, in _inner_hf_hub_download
return hf_hub_download(
File "C:\Users\ShinOnii\Downloads\GigaGAN_Upscaler_v4\venv\lib\site-packages\huggingface_hub\utils\_validators.py", line 114, in _inner_fn
return fn(*args, **kwargs)
File "C:\Users\ShinOnii\Downloads\GigaGAN_Upscaler_v4\venv\lib\site-packages\huggingface_hub\file_download.py", line 860, in hf_hub_download
return _hf_hub_download_to_cache_dir(
File "C:\Users\ShinOnii\Downloads\GigaGAN_Upscaler_v4\venv\lib\site-packages\huggingface_hub\file_download.py", line 1009, in _hf_hub_download_to_cache_dir
_download_to_tmp_and_move(
File "C:\Users\ShinOnii\Downloads\GigaGAN_Upscaler_v4\venv\lib\site-packages\huggingface_hub\file_download.py", line 1543, in _download_to_tmp_and_move
http_get(
File "C:\Users\ShinOnii\Downloads\GigaGAN_Upscaler_v4\venv\lib\site-packages\huggingface_hub\file_download.py", line 437, in http_get
raise RuntimeError(
RuntimeError: An error occurred while downloading using `hf_transfer`. Consider disabling HF_HUB_ENABLE_HF_TRANSFER for better error handling.
Press any key to continue . . .
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.