mirror of
https://github.com/denizsafak/abogen.git
synced 2026-09-20 11:40:57 +02:00
Fix spurious HF HEAD requests: return early on cache hit in tracked_hf_hub_download
This commit is contained in:
@@ -19,7 +19,7 @@ def tracked_hf_hub_download(*args, **kwargs):
|
|||||||
try:
|
try:
|
||||||
local_kwargs = dict(kwargs)
|
local_kwargs = dict(kwargs)
|
||||||
local_kwargs["local_files_only"] = True
|
local_kwargs["local_files_only"] = True
|
||||||
hf_hub_download(*args, **local_kwargs)
|
return hf_hub_download(*args, **local_kwargs)
|
||||||
except Exception:
|
except Exception:
|
||||||
repo_id = kwargs.get("repo_id", "<unknown repo>")
|
repo_id = kwargs.get("repo_id", "<unknown repo>")
|
||||||
filename = kwargs.get("filename", "<unknown file>")
|
filename = kwargs.get("filename", "<unknown file>")
|
||||||
|
|||||||
Reference in New Issue
Block a user