mirror of
https://github.com/modelscope/modelscope.git
synced 2026-02-24 12:10:09 +01:00
ok Merge branch 'master' of github.com:modelscope/modelscope into release/1.24
This commit is contained in:
@@ -238,10 +238,8 @@ def _snapshot_download(
|
||||
headers = {
|
||||
'user-agent':
|
||||
ModelScopeConfig.get_user_agent(user_agent=user_agent, ),
|
||||
'snapshot-identifier': str(uuid.uuid4()),
|
||||
}
|
||||
if 'CI_TEST' not in os.environ:
|
||||
# To count the download statistics, to add the snapshot-identifier as a header.
|
||||
headers['snapshot-identifier'] = str(uuid.uuid4())
|
||||
_api = HubApi()
|
||||
if cookies is None:
|
||||
cookies = ModelScopeConfig.get_cookies()
|
||||
@@ -258,12 +256,12 @@ def _snapshot_download(
|
||||
repo_id, revision=revision, cookies=cookies)
|
||||
revision = revision_detail['Revision']
|
||||
|
||||
snapshot_header = headers if 'CI_TEST' in os.environ else {
|
||||
**headers,
|
||||
**{
|
||||
'Snapshot': 'True'
|
||||
}
|
||||
}
|
||||
# Add snapshot-ci-test for counting the ci test download
|
||||
if 'CI_TEST' in os.environ:
|
||||
snapshot_header = {**headers, **{'snapshot-ci-test': 'True'}}
|
||||
else:
|
||||
snapshot_header = {**headers, **{'Snapshot': 'True'}}
|
||||
|
||||
if cache.cached_model_revision is not None:
|
||||
snapshot_header[
|
||||
'cached_model_revision'] = cache.cached_model_revision
|
||||
|
||||
@@ -106,8 +106,9 @@ def get_release_datetime():
|
||||
|
||||
|
||||
def get_endpoint():
|
||||
modelscope_domain = os.getenv('MODELSCOPE_DOMAIN',
|
||||
DEFAULT_MODELSCOPE_DOMAIN)
|
||||
modelscope_domain = os.getenv(
|
||||
'MODELSCOPE_DOMAIN',
|
||||
DEFAULT_MODELSCOPE_DOMAIN) or DEFAULT_MODELSCOPE_DOMAIN
|
||||
return MODELSCOPE_URL_SCHEME + modelscope_domain
|
||||
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@ DATASET_LFS_SUFFIX = [
|
||||
'.jack',
|
||||
'.jpeg',
|
||||
'.jpg',
|
||||
'.png',
|
||||
'.jsonl',
|
||||
'.joblib',
|
||||
'.lz4',
|
||||
|
||||
Reference in New Issue
Block a user