Skip to content

Commit 0dd879b

Browse files
committed
Fix proxy if dynamic endpoint
1 parent 4e738e2 commit 0dd879b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/huggingface_hub/hf_api.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,9 @@ def __new__(cls, url: Any, endpoint: Optional[str] = None):
435435
if ENDPOINT not in (_HF_DEFAULT_ENDPOINT, _HF_DEFAULT_STAGING_ENDPOINT):
436436
url = url.replace(_HF_DEFAULT_ENDPOINT, ENDPOINT)
437437
url = url.replace(_HF_DEFAULT_STAGING_ENDPOINT, ENDPOINT)
438+
if endpoint not in (None, _HF_DEFAULT_ENDPOINT, _HF_DEFAULT_STAGING_ENDPOINT):
439+
url = url.replace(_HF_DEFAULT_ENDPOINT, endpoint)
440+
url = url.replace(_HF_DEFAULT_STAGING_ENDPOINT, endpoint)
438441

439442
return super(RepoUrl, cls).__new__(cls, url)
440443

0 commit comments

Comments
 (0)