From 4cade81a35fb0fd6ee80403eafb149346941a38a Mon Sep 17 00:00:00 2001 From: Yingda Chen Date: Thu, 13 Mar 2025 14:30:08 +0800 Subject: [PATCH] use user-specified domain only when it is non-empty --- modelscope/hub/api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modelscope/hub/api.py b/modelscope/hub/api.py index eb72a2b4..b6d68125 100644 --- a/modelscope/hub/api.py +++ b/modelscope/hub/api.py @@ -316,7 +316,8 @@ class HubApi: return the endpoint with which the given repo_id exists. if neither exists, throw 404 error """ - if MODELSCOPE_DOMAIN in os.environ: + s = os.environ.get(MODELSCOPE_DOMAIN) + if s is not None and s.strip() != '': endpoint = MODELSCOPE_URL_SCHEME + os.getenv(MODELSCOPE_DOMAIN) try: self.repo_exists(repo_id=repo_id, repo_type=repo_type, endpoint=endpoint, re_raise=True)