huggingface-hub 0.21.2__tar.gz → 0.21.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of huggingface-hub might be problematic. Click here for more details.
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/PKG-INFO +1 -1
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/__init__.py +1 -1
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/hub_mixin.py +17 -9
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub.egg-info/PKG-INFO +1 -1
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/LICENSE +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/MANIFEST.in +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/README.md +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/pyproject.toml +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/setup.cfg +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/setup.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/_commit_api.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/_commit_scheduler.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/_inference_endpoints.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/_login.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/_multi_commits.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/_snapshot_download.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/_space_api.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/_tensorboard_logger.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/_webhooks_payload.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/_webhooks_server.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/commands/__init__.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/commands/_cli_utils.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/commands/delete_cache.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/commands/download.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/commands/env.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/commands/huggingface_cli.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/commands/lfs.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/commands/scan_cache.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/commands/upload.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/commands/user.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/community.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/constants.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/fastai_utils.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/file_download.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/hf_api.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/hf_file_system.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/inference/__init__.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/inference/_client.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/inference/_common.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/inference/_generated/__init__.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/inference/_generated/_async_client.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/inference/_text_generation.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/inference/_types.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/inference_api.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/keras_mixin.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/lfs.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/repocard.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/repocard_data.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/repository.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/serialization/__init__.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/serialization/_base.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/serialization/_numpy.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/serialization/_tensorflow.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/serialization/_torch.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/templates/datasetcard_template.md +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/templates/modelcard_template.md +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/utils/__init__.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/utils/_cache_assets.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/utils/_cache_manager.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/utils/_chunk_utils.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/utils/_datetime.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/utils/_deprecation.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/utils/_errors.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/utils/_experimental.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/utils/_fixes.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/utils/_git_credential.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/utils/_headers.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/utils/_hf_folder.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/utils/_http.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/utils/_pagination.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/utils/_paths.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/utils/_runtime.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/utils/_safetensors.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/utils/_subprocess.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/utils/_telemetry.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/utils/_token.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/utils/_typing.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/utils/_validators.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/utils/endpoint_helpers.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/utils/insecure_hashlib.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/utils/logging.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/utils/sha.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/utils/tqdm.py +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub.egg-info/SOURCES.txt +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub.egg-info/dependency_links.txt +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub.egg-info/entry_points.txt +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub.egg-info/requires.txt +0 -0
- {huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: huggingface_hub
|
|
3
|
-
Version: 0.21.
|
|
3
|
+
Version: 0.21.4
|
|
4
4
|
Summary: Client library to download and publish models, datasets and other repos on the huggingface.co hub
|
|
5
5
|
Home-page: https://github.com/huggingface/huggingface_hub
|
|
6
6
|
Author: Hugging Face, Inc.
|
|
@@ -27,8 +27,8 @@ if is_torch_available():
|
|
|
27
27
|
import torch # type: ignore
|
|
28
28
|
|
|
29
29
|
if is_safetensors_available():
|
|
30
|
-
from safetensors import
|
|
31
|
-
from safetensors.torch import
|
|
30
|
+
from safetensors.torch import load_model as load_model_as_safetensor
|
|
31
|
+
from safetensors.torch import save_model as save_model_as_safetensor
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
logger = logging.get_logger(__name__)
|
|
@@ -270,6 +270,9 @@ class ModelHubMixin:
|
|
|
270
270
|
|
|
271
271
|
# Forward config to model initialization
|
|
272
272
|
model_kwargs["config"] = config
|
|
273
|
+
elif any(param.kind == inspect.Parameter.VAR_KEYWORD for param in init_parameters.values()):
|
|
274
|
+
# If __init__ accepts **kwargs, let's forward the config as well (as a dict)
|
|
275
|
+
model_kwargs["config"] = config
|
|
273
276
|
|
|
274
277
|
instance = cls._from_pretrained(
|
|
275
278
|
model_id=str(model_id),
|
|
@@ -460,7 +463,7 @@ class PyTorchModelHubMixin(ModelHubMixin):
|
|
|
460
463
|
def _save_pretrained(self, save_directory: Path) -> None:
|
|
461
464
|
"""Save weights from a Pytorch model to a local directory."""
|
|
462
465
|
model_to_save = self.module if hasattr(self, "module") else self # type: ignore
|
|
463
|
-
|
|
466
|
+
save_model_as_safetensor(model_to_save, str(save_directory / SAFETENSORS_SINGLE_FILE))
|
|
464
467
|
|
|
465
468
|
@classmethod
|
|
466
469
|
def _from_pretrained(
|
|
@@ -521,10 +524,15 @@ class PyTorchModelHubMixin(ModelHubMixin):
|
|
|
521
524
|
|
|
522
525
|
@classmethod
|
|
523
526
|
def _load_as_safetensor(cls, model: T, model_file: str, map_location: str, strict: bool) -> T:
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
527
|
+
load_model_as_safetensor(model, model_file, strict=strict) # type: ignore [arg-type]
|
|
528
|
+
if map_location != "cpu":
|
|
529
|
+
# TODO: remove this once https://github.com/huggingface/safetensors/pull/449 is merged.
|
|
530
|
+
logger.warning(
|
|
531
|
+
"Loading model weights on other devices than 'cpu' is not supported natively."
|
|
532
|
+
" This means that the model is loaded on 'cpu' first and then copied to the device."
|
|
533
|
+
" This leads to a slower loading time."
|
|
534
|
+
" Support for loading directly on other devices is planned to be added in future releases."
|
|
535
|
+
" See https://github.com/huggingface/huggingface_hub/pull/2086 for more details."
|
|
536
|
+
)
|
|
537
|
+
model.to(map_location) # type: ignore [attr-defined]
|
|
530
538
|
return model
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: huggingface-hub
|
|
3
|
-
Version: 0.21.
|
|
3
|
+
Version: 0.21.4
|
|
4
4
|
Summary: Client library to download and publish models, datasets and other repos on the huggingface.co hub
|
|
5
5
|
Home-page: https://github.com/huggingface/huggingface_hub
|
|
6
6
|
Author: Hugging Face, Inc.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/_inference_endpoints.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/_tensorboard_logger.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/commands/_cli_utils.py
RENAMED
|
File without changes
|
{huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/commands/delete_cache.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/commands/huggingface_cli.py
RENAMED
|
File without changes
|
|
File without changes
|
{huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/commands/scan_cache.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/inference/_text_generation.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/serialization/__init__.py
RENAMED
|
File without changes
|
{huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/serialization/_base.py
RENAMED
|
File without changes
|
{huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/serialization/_numpy.py
RENAMED
|
File without changes
|
{huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/serialization/_tensorflow.py
RENAMED
|
File without changes
|
{huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/serialization/_torch.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/utils/_cache_assets.py
RENAMED
|
File without changes
|
{huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/utils/_cache_manager.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/utils/_experimental.py
RENAMED
|
File without changes
|
|
File without changes
|
{huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/utils/_git_credential.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/utils/endpoint_helpers.py
RENAMED
|
File without changes
|
{huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub/utils/insecure_hashlib.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub.egg-info/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|
{huggingface_hub-0.21.2 → huggingface_hub-0.21.4}/src/huggingface_hub.egg-info/top_level.txt
RENAMED
|
File without changes
|