transformers
01047321 - [conftest] Also wrap snapshot_download for EROFS fallback (#47796)

Commit
4 days ago
[conftest] Also wrap snapshot_download for EROFS fallback (#47796) * [conftest] also wrap snapshot_download for EROFS fallback `kernels` calls both `api.hf_hub_download` and `api.snapshot_download`. `HfApi.snapshot_download` uses a local import at call time: `from ._snapshot_download import snapshot_download` so patching `_snapshot_download.snapshot_download` is picked up correctly. Wrapping the entire `snapshot_download` (rather than its inner `hf_hub_download` calls) ensures the retry uses `cache_dir=tmp_dir` everywhere — `_inner_hf_hub_download` passes `cache_dir` explicitly, so all files and the returned snapshot path land in the tmp dir. The OSError from a failed thread propagates through `future.result()` and `hf_thread_map` as a plain OSError, which the wrapper catches. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * another --------- Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
Author
Parents
Loading