Skip to content

Commit

Permalink
fix(#2806): Replace urljoin for HF_ENDPOINT paths (#2807)
Browse files Browse the repository at this point in the history
  • Loading branch information
anael-l authored and Wauplin committed Jan 30, 2025
1 parent 7cde837 commit e0e891d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/huggingface_hub/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import re
import typing
from typing import Literal, Optional, Tuple
from urllib.parse import urljoin


# Possible values for env variables
Expand Down Expand Up @@ -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"
Expand All @@ -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
Expand Down

0 comments on commit e0e891d

Please sign in to comment.