diff --git a/src/huggingface_hub/constants.py b/src/huggingface_hub/constants.py index e430c97bcd..32658d92fe 100644 --- a/src/huggingface_hub/constants.py +++ b/src/huggingface_hub/constants.py @@ -2,7 +2,6 @@ import re import typing from typing import Literal, Optional, Tuple -from urllib.parse import urljoin # Possible values for env variables @@ -68,7 +67,7 @@ def _as_int(value: Optional[str]) -> Optional[int]: _HF_DEFAULT_STAGING_ENDPOINT if _staging_mode else _HF_DEFAULT_ENDPOINT ) -HUGGINGFACE_CO_URL_TEMPLATE = urljoin(ENDPOINT, "/{repo_id}/resolve/{revision}/{filename}") +HUGGINGFACE_CO_URL_TEMPLATE = ENDPOINT + "/{repo_id}/resolve/{revision}/{filename}" HUGGINGFACE_HEADER_X_REPO_COMMIT = "X-Repo-Commit" HUGGINGFACE_HEADER_X_LINKED_ETAG = "X-Linked-Etag" HUGGINGFACE_HEADER_X_LINKED_SIZE = "X-Linked-Size" @@ -79,7 +78,7 @@ def _as_int(value: Optional[str]) -> Optional[int]: INFERENCE_ENDPOINTS_ENDPOINT = "https://api.endpoints.huggingface.cloud/v2" # Proxy for third-party providers -INFERENCE_PROXY_TEMPLATE = urljoin(ENDPOINT, "/api/inference-proxy/{provider}") +INFERENCE_PROXY_TEMPLATE = ENDPOINT + "/api/inference-proxy/{provider}" REPO_ID_SEPARATOR = "--" # ^ this substring is not allowed in repo_ids on hf.co