Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 3 additions & 15 deletions src/huggingface_hub/hf_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2759,11 +2759,7 @@ def model_info(
raise ValueError("`expand` cannot be used if `securityStatus` or `files_metadata` are set.")

headers = self._build_hf_headers(token=token)
path = (
f"{self.endpoint}/api/models/{repo_id}"
if revision is None
else (f"{self.endpoint}/api/models/{repo_id}/revision/{quote(revision, safe='')}")
)
path = f"{self.endpoint}/api/models/{repo_id}/revision/{quote(revision or constants.DEFAULT_REVISION, safe='')}"
params: dict = {}
if securityStatus:
params["securityStatus"] = True
Expand Down Expand Up @@ -2830,11 +2826,7 @@ def dataset_info(
raise ValueError("`expand` cannot be used if `files_metadata` is set.")

headers = self._build_hf_headers(token=token)
path = (
f"{self.endpoint}/api/datasets/{repo_id}"
if revision is None
else (f"{self.endpoint}/api/datasets/{repo_id}/revision/{quote(revision, safe='')}")
)
path = f"{self.endpoint}/api/datasets/{repo_id}/revision/{quote(revision or constants.DEFAULT_REVISION, safe='')}"
params: dict = {}
if files_metadata:
params["blobs"] = True
Expand Down Expand Up @@ -2900,11 +2892,7 @@ def space_info(
raise ValueError("`expand` cannot be used if `files_metadata` is set.")

headers = self._build_hf_headers(token=token)
path = (
f"{self.endpoint}/api/spaces/{repo_id}"
if revision is None
else (f"{self.endpoint}/api/spaces/{repo_id}/revision/{quote(revision, safe='')}")
)
path = f"{self.endpoint}/api/spaces/{repo_id}/revision/{quote(revision or constants.DEFAULT_REVISION, safe='')}"
params: dict = {}
if files_metadata:
params["blobs"] = True
Expand Down
Loading