Skip to content

Commit d1488f9

Browse files
Refactor: reuse HfApi instance for endpoint
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: Shuting Zhao <shuting.zhao@outlook.com>
1 parent 2ed756a commit d1488f9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/llmcompressor/transformers/utils/helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ def recipe_from_huggingface_model_id(
150150
return None
151151

152152
# Use custom HF_ENDPOINT
153-
hf_endpoint = HfApi().endpoint.rstrip("/")
154-
model_id_url = f"{hf_endpoint}/{hf_stub}"
153+
hf_api = HfApi()
154+
model_id_url = f"{hf_api.endpoint.rstrip('/')}/{hf_stub}"
155155
request = requests.head(model_id_url)
156156

157157
if request.status_code != 200:

0 commit comments

Comments
 (0)