Skip to content

Commit e0e891d

Browse files
anael-lWauplin
authored andcommitted
fix(#2806): Replace urljoin for HF_ENDPOINT paths (#2807)
1 parent 7cde837 commit e0e891d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/huggingface_hub/constants.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import re
33
import typing
44
from typing import Literal, Optional, Tuple
5-
from urllib.parse import urljoin
65

76

87
# Possible values for env variables
@@ -68,7 +67,7 @@ def _as_int(value: Optional[str]) -> Optional[int]:
6867
_HF_DEFAULT_STAGING_ENDPOINT if _staging_mode else _HF_DEFAULT_ENDPOINT
6968
)
7069

71-
HUGGINGFACE_CO_URL_TEMPLATE = urljoin(ENDPOINT, "/{repo_id}/resolve/{revision}/{filename}")
70+
HUGGINGFACE_CO_URL_TEMPLATE = ENDPOINT + "/{repo_id}/resolve/{revision}/{filename}"
7271
HUGGINGFACE_HEADER_X_REPO_COMMIT = "X-Repo-Commit"
7372
HUGGINGFACE_HEADER_X_LINKED_ETAG = "X-Linked-Etag"
7473
HUGGINGFACE_HEADER_X_LINKED_SIZE = "X-Linked-Size"
@@ -79,7 +78,7 @@ def _as_int(value: Optional[str]) -> Optional[int]:
7978
INFERENCE_ENDPOINTS_ENDPOINT = "https://api.endpoints.huggingface.cloud/v2"
8079

8180
# Proxy for third-party providers
82-
INFERENCE_PROXY_TEMPLATE = urljoin(ENDPOINT, "/api/inference-proxy/{provider}")
81+
INFERENCE_PROXY_TEMPLATE = ENDPOINT + "/api/inference-proxy/{provider}"
8382

8483
REPO_ID_SEPARATOR = "--"
8584
# ^ this substring is not allowed in repo_ids on hf.co

0 commit comments

Comments
 (0)