From 35f08d4930f76e222b73174d7293bfef123bb493 Mon Sep 17 00:00:00 2001 From: simpx Date: Thu, 8 May 2025 10:34:50 +0800 Subject: [PATCH] Add "HF_ENDPOINT" support for "download" --- src/huggingface_hub/commands/download.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/huggingface_hub/commands/download.py b/src/huggingface_hub/commands/download.py index 10e22c3d1e..8ce60d90b6 100644 --- a/src/huggingface_hub/commands/download.py +++ b/src/huggingface_hub/commands/download.py @@ -36,6 +36,7 @@ huggingface-cli download gpt2 --local-dir=./models/gpt2 """ +import os import warnings from argparse import Namespace, _SubParsersAction from typing import List, Optional @@ -197,4 +198,5 @@ def _download(self) -> str: local_dir=self.local_dir, library_name="huggingface-cli", max_workers=self.max_workers, + endpoint=os.environ.get('HF_ENDPOINT', None) )