mirror of
https://github.com/modelscope/modelscope.git
synced 2026-07-12 13:29:22 +02:00
[to #43019862]feat: remove gitlab address
去掉gitlab地址配置
Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/9256404
* remove gitlab address
This commit is contained in:
@@ -15,8 +15,7 @@ from ..utils.constant import DownloadMode
|
||||
from .constants import MODELSCOPE_URL_SCHEME
|
||||
from .errors import (InvalidParameter, NotExistError, datahub_raise_on_error,
|
||||
is_ok, raise_on_error)
|
||||
from .utils.utils import (get_endpoint, get_gitlab_domain,
|
||||
model_id_to_group_owner_name)
|
||||
from .utils.utils import get_endpoint, model_id_to_group_owner_name
|
||||
|
||||
logger = get_logger()
|
||||
|
||||
@@ -109,7 +108,7 @@ class HubApi:
|
||||
cookies=cookies)
|
||||
r.raise_for_status()
|
||||
raise_on_error(r.json())
|
||||
model_repo_url = f'{MODELSCOPE_URL_SCHEME}{get_gitlab_domain()}/{model_id}'
|
||||
model_repo_url = f'{get_endpoint()}/{model_id}'
|
||||
return model_repo_url
|
||||
|
||||
def delete_model(self, model_id):
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
MODELSCOPE_URL_SCHEME = 'http://'
|
||||
DEFAULT_MODELSCOPE_IP = '47.94.223.21'
|
||||
DEFAULT_MODELSCOPE_DOMAIN = DEFAULT_MODELSCOPE_IP + ':31090'
|
||||
DEFAULT_MODELSCOPE_GITLAB_DOMAIN = '101.201.119.157:31102'
|
||||
DEFAULT_MODELSCOPE_DATA_ENDPOINT = MODELSCOPE_URL_SCHEME + DEFAULT_MODELSCOPE_IP + ':31752'
|
||||
|
||||
DEFAULT_MODELSCOPE_GROUP = 'damo'
|
||||
|
||||
@@ -6,7 +6,7 @@ from modelscope.utils.logger import get_logger
|
||||
from .api import ModelScopeConfig
|
||||
from .constants import MODELSCOPE_URL_SCHEME
|
||||
from .git import GitCommandWrapper
|
||||
from .utils.utils import get_gitlab_domain
|
||||
from .utils.utils import get_endpoint
|
||||
|
||||
logger = get_logger()
|
||||
|
||||
@@ -65,7 +65,7 @@ class Repository:
|
||||
git_wrapper.git_lfs_install(self.model_dir) # init repo lfs
|
||||
|
||||
def _get_model_id_url(self, model_id):
|
||||
url = f'{MODELSCOPE_URL_SCHEME}{get_gitlab_domain()}/{model_id}.git'
|
||||
url = f'{get_endpoint()}/{model_id}.git'
|
||||
return url
|
||||
|
||||
def _get_remote_url(self):
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import os
|
||||
|
||||
from modelscope.hub.constants import (DEFAULT_MODELSCOPE_DOMAIN,
|
||||
DEFAULT_MODELSCOPE_GITLAB_DOMAIN,
|
||||
DEFAULT_MODELSCOPE_GROUP,
|
||||
MODEL_ID_SEPARATOR,
|
||||
MODELSCOPE_URL_SCHEME)
|
||||
@@ -32,8 +31,3 @@ def get_endpoint():
|
||||
modelscope_domain = os.getenv('MODELSCOPE_DOMAIN',
|
||||
DEFAULT_MODELSCOPE_DOMAIN)
|
||||
return MODELSCOPE_URL_SCHEME + modelscope_domain
|
||||
|
||||
|
||||
def get_gitlab_domain():
|
||||
return os.getenv('MODELSCOPE_GITLAB_DOMAIN',
|
||||
DEFAULT_MODELSCOPE_GITLAB_DOMAIN)
|
||||
|
||||
Reference in New Issue
Block a user