Skip to content

Commit

Permalink
MNT Rename the env variable HF_ENDPOINT. (#819)
Browse files Browse the repository at this point in the history
* Rename the env variable `HF_ENDPOINT`.

* Reuse `ENDPOINT` constant to reduce name clashes.

* Quality.
  • Loading branch information
Narsil authored Apr 5, 2022
1 parent 912078f commit bee7f64
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/huggingface_hub/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
os.environ.get("HUGGINGFACE_CO_STAGING", "NO").upper() in ENV_VARS_TRUE_VALUES
)

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

Expand Down
4 changes: 1 addition & 3 deletions src/huggingface_hub/hf_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,9 +466,7 @@ def erase_from_credential_store(username=None):

class HfApi:
def __init__(self, endpoint=None):
self.endpoint = (
endpoint if endpoint is not None else os.getenv("HF_ENDPOINT", ENDPOINT)
)
self.endpoint = endpoint if endpoint is not None else ENDPOINT

def login(self, username: str, password: str) -> str:
"""
Expand Down

0 comments on commit bee7f64

Please sign in to comment.