Skip to content

Commit bee7f64

Browse files
authored
MNT Rename the env variable HF_ENDPOINT. (#819)
* Rename the env variable `HF_ENDPOINT`. * Reuse `ENDPOINT` constant to reduce name clashes. * Quality.
1 parent 912078f commit bee7f64

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/huggingface_hub/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
os.environ.get("HUGGINGFACE_CO_STAGING", "NO").upper() in ENV_VARS_TRUE_VALUES
2525
)
2626

27-
ENDPOINT = os.getenv("HF_HUB_URL") or (
27+
ENDPOINT = os.getenv("HF_ENDPOINT") or (
2828
"https://moon-staging.huggingface.co" if _staging_mode else "https://huggingface.co"
2929
)
3030

src/huggingface_hub/hf_api.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -466,9 +466,7 @@ def erase_from_credential_store(username=None):
466466

467467
class HfApi:
468468
def __init__(self, endpoint=None):
469-
self.endpoint = (
470-
endpoint if endpoint is not None else os.getenv("HF_ENDPOINT", ENDPOINT)
471-
)
469+
self.endpoint = endpoint if endpoint is not None else ENDPOINT
472470

473471
def login(self, username: str, password: str) -> str:
474472
"""

0 commit comments

Comments
 (0)