merge release/1.23 to master

This commit is contained in:
xingjun.wxj
2025-03-11 10:17:28 +08:00
2 changed files with 11 additions and 5 deletions

View File

@@ -345,7 +345,7 @@ def _patch_pretrained_class(all_imported_modules, wrap=False):
else:
all_available_modules.append(
get_wrapped_class(var, **ignore_file_pattern_kwargs))
except: # noqa
except Exception:
all_available_modules.append(var)
else:
if has_from_pretrained and not hasattr(var,
@@ -370,9 +370,10 @@ def _patch_pretrained_class(all_imported_modules, wrap=False):
if has_get_config_dict and not hasattr(var,
'_get_config_dict_origin'):
var._get_config_dict_origin = var.get_config_dict
var.get_config_dict = classmethod(
partial(patch_get_config_dict,
**ignore_file_pattern_kwargs))
var.get_config_dict = partial(
patch_pretrained_model_name_or_path,
ori_func=var._get_config_dict_origin,
**ignore_file_pattern_kwargs)
all_available_modules.append(var)
return all_available_modules
@@ -618,6 +619,11 @@ def _patch_hub():
# Patch repocard.validate
from huggingface_hub import repocard
if not hasattr(repocard.RepoCard, '_validate_origin'):
def load(*args, **kwargs):
from huggingface_hub.errors import EntryNotFoundError
raise EntryNotFoundError(message='API not supported.')
repocard.RepoCard._validate_origin = repocard.RepoCard.validate
repocard.RepoCard.validate = lambda *args, **kwargs: None
repocard.RepoCard._load_origin = repocard.RepoCard.load

View File

@@ -2,4 +2,4 @@
__version__ = '2.0.0'
# default release datetime for branches under active development is set
# to be a time far-far-away-into-the-future
__release_datetime__ = '2099-09-06 00:00:00'
__release_datetime__ = '2099-09-06 00:00:00'