huggingface-hub 0.27.0rc0__py3-none-any.whl → 0.27.1__py3-none-any.whl
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/__init__.py +1 -1
- huggingface_hub/hub_mixin.py +12 -9
- huggingface_hub/inference/_generated/types/automatic_speech_recognition.py +3 -2
- huggingface_hub/inference/_generated/types/image_to_text.py +3 -2
- huggingface_hub/inference/_generated/types/text_to_audio.py +2 -1
- huggingface_hub/inference/_generated/types/text_to_speech.py +2 -1
- {huggingface_hub-0.27.0rc0.dist-info → huggingface_hub-0.27.1.dist-info}/METADATA +1 -1
- {huggingface_hub-0.27.0rc0.dist-info → huggingface_hub-0.27.1.dist-info}/RECORD +12 -12
- {huggingface_hub-0.27.0rc0.dist-info → huggingface_hub-0.27.1.dist-info}/LICENSE +0 -0
- {huggingface_hub-0.27.0rc0.dist-info → huggingface_hub-0.27.1.dist-info}/WHEEL +0 -0
- {huggingface_hub-0.27.0rc0.dist-info → huggingface_hub-0.27.1.dist-info}/entry_points.txt +0 -0
- {huggingface_hub-0.27.0rc0.dist-info → huggingface_hub-0.27.1.dist-info}/top_level.txt +0 -0
huggingface_hub/__init__.py
CHANGED
huggingface_hub/hub_mixin.py
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import inspect
|
|
2
2
|
import json
|
|
3
3
|
import os
|
|
4
|
-
from dataclasses import asdict, dataclass, is_dataclass
|
|
4
|
+
from dataclasses import Field, asdict, dataclass, is_dataclass
|
|
5
5
|
from pathlib import Path
|
|
6
|
-
from typing import
|
|
6
|
+
from typing import Any, Callable, ClassVar, Dict, List, Optional, Protocol, Tuple, Type, TypeVar, Union
|
|
7
7
|
|
|
8
8
|
import packaging.version
|
|
9
9
|
|
|
@@ -24,9 +24,6 @@ from .utils import (
|
|
|
24
24
|
)
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
if TYPE_CHECKING:
|
|
28
|
-
from _typeshed import DataclassInstance
|
|
29
|
-
|
|
30
27
|
if is_torch_available():
|
|
31
28
|
import torch # type: ignore
|
|
32
29
|
|
|
@@ -38,6 +35,12 @@ if is_safetensors_available():
|
|
|
38
35
|
|
|
39
36
|
logger = logging.get_logger(__name__)
|
|
40
37
|
|
|
38
|
+
|
|
39
|
+
# Type alias for dataclass instances, copied from https://github.com/python/typeshed/blob/9f28171658b9ca6c32a7cb93fbb99fc92b17858b/stdlib/_typeshed/__init__.pyi#L349
|
|
40
|
+
class DataclassInstance(Protocol):
|
|
41
|
+
__dataclass_fields__: ClassVar[Dict[str, Field]]
|
|
42
|
+
|
|
43
|
+
|
|
41
44
|
# Generic variable that is either ModelHubMixin or a subclass thereof
|
|
42
45
|
T = TypeVar("T", bound="ModelHubMixin")
|
|
43
46
|
# Generic variable to represent an args type
|
|
@@ -175,7 +178,7 @@ class ModelHubMixin:
|
|
|
175
178
|
```
|
|
176
179
|
"""
|
|
177
180
|
|
|
178
|
-
_hub_mixin_config: Optional[Union[dict,
|
|
181
|
+
_hub_mixin_config: Optional[Union[dict, DataclassInstance]] = None
|
|
179
182
|
# ^ optional config attribute automatically set in `from_pretrained`
|
|
180
183
|
_hub_mixin_info: MixinInfo
|
|
181
184
|
# ^ information about the library integrating ModelHubMixin (used to generate model card)
|
|
@@ -366,7 +369,7 @@ class ModelHubMixin:
|
|
|
366
369
|
self,
|
|
367
370
|
save_directory: Union[str, Path],
|
|
368
371
|
*,
|
|
369
|
-
config: Optional[Union[dict,
|
|
372
|
+
config: Optional[Union[dict, DataclassInstance]] = None,
|
|
370
373
|
repo_id: Optional[str] = None,
|
|
371
374
|
push_to_hub: bool = False,
|
|
372
375
|
model_card_kwargs: Optional[Dict[str, Any]] = None,
|
|
@@ -618,7 +621,7 @@ class ModelHubMixin:
|
|
|
618
621
|
self,
|
|
619
622
|
repo_id: str,
|
|
620
623
|
*,
|
|
621
|
-
config: Optional[Union[dict,
|
|
624
|
+
config: Optional[Union[dict, DataclassInstance]] = None,
|
|
622
625
|
commit_message: str = "Push model using huggingface_hub.",
|
|
623
626
|
private: Optional[bool] = None,
|
|
624
627
|
token: Optional[str] = None,
|
|
@@ -825,7 +828,7 @@ class PyTorchModelHubMixin(ModelHubMixin):
|
|
|
825
828
|
return model
|
|
826
829
|
|
|
827
830
|
|
|
828
|
-
def _load_dataclass(datacls: Type[
|
|
831
|
+
def _load_dataclass(datacls: Type[DataclassInstance], data: dict) -> DataclassInstance:
|
|
829
832
|
"""Load a dataclass instance from a dictionary.
|
|
830
833
|
|
|
831
834
|
Fields not expected by the dataclass are ignored.
|
|
@@ -76,10 +76,11 @@ class AutomaticSpeechRecognitionGenerationParameters(BaseInferenceType):
|
|
|
76
76
|
class AutomaticSpeechRecognitionParameters(BaseInferenceType):
|
|
77
77
|
"""Additional inference parameters for Automatic Speech Recognition"""
|
|
78
78
|
|
|
79
|
-
generation_parameters: Optional[AutomaticSpeechRecognitionGenerationParameters] = None
|
|
80
|
-
"""Parametrization of the text generation process"""
|
|
81
79
|
return_timestamps: Optional[bool] = None
|
|
82
80
|
"""Whether to output corresponding timestamps with the generated text"""
|
|
81
|
+
# Will be deprecated in the future when the renaming to `generation_parameters` is implemented in transformers
|
|
82
|
+
generate_kwargs: Optional[AutomaticSpeechRecognitionGenerationParameters] = None
|
|
83
|
+
"""Parametrization of the text generation process"""
|
|
83
84
|
|
|
84
85
|
|
|
85
86
|
@dataclass
|
|
@@ -76,10 +76,11 @@ class ImageToTextGenerationParameters(BaseInferenceType):
|
|
|
76
76
|
class ImageToTextParameters(BaseInferenceType):
|
|
77
77
|
"""Additional inference parameters for Image To Text"""
|
|
78
78
|
|
|
79
|
-
generation_parameters: Optional[ImageToTextGenerationParameters] = None
|
|
80
|
-
"""Parametrization of the text generation process"""
|
|
81
79
|
max_new_tokens: Optional[int] = None
|
|
82
80
|
"""The amount of maximum tokens to generate."""
|
|
81
|
+
# Will be deprecated in the future when the renaming to `generation_parameters` is implemented in transformers
|
|
82
|
+
generate_kwargs: Optional[ImageToTextGenerationParameters] = None
|
|
83
|
+
"""Parametrization of the text generation process"""
|
|
83
84
|
|
|
84
85
|
|
|
85
86
|
@dataclass
|
|
@@ -76,7 +76,8 @@ class TextToAudioGenerationParameters(BaseInferenceType):
|
|
|
76
76
|
class TextToAudioParameters(BaseInferenceType):
|
|
77
77
|
"""Additional inference parameters for Text To Audio"""
|
|
78
78
|
|
|
79
|
-
generation_parameters
|
|
79
|
+
# Will be deprecated in the future when the renaming to `generation_parameters` is implemented in transformers
|
|
80
|
+
generate_kwargs: Optional[TextToAudioGenerationParameters] = None
|
|
80
81
|
"""Parametrization of the text generation process"""
|
|
81
82
|
|
|
82
83
|
|
|
@@ -76,7 +76,8 @@ class TextToSpeechGenerationParameters(BaseInferenceType):
|
|
|
76
76
|
class TextToSpeechParameters(BaseInferenceType):
|
|
77
77
|
"""Additional inference parameters for Text To Speech"""
|
|
78
78
|
|
|
79
|
-
generation_parameters
|
|
79
|
+
# Will be deprecated in the future when the renaming to `generation_parameters` is implemented in transformers
|
|
80
|
+
generate_kwargs: Optional[TextToSpeechGenerationParameters] = None
|
|
80
81
|
"""Parametrization of the text generation process"""
|
|
81
82
|
|
|
82
83
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: huggingface-hub
|
|
3
|
-
Version: 0.27.
|
|
3
|
+
Version: 0.27.1
|
|
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.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
huggingface_hub/__init__.py,sha256=
|
|
1
|
+
huggingface_hub/__init__.py,sha256=H7Ix9FZmAV3W2n5dLRciWwO8UOwGwlDfvY7SGYx2nOw,37213
|
|
2
2
|
huggingface_hub/_commit_api.py,sha256=Y9eTaW4bYzxtrZsSniVtfeAuFafqx8x1ofMI5es8hvM,31057
|
|
3
3
|
huggingface_hub/_commit_scheduler.py,sha256=tfIoO1xWHjTJ6qy6VS6HIoymDycFPg0d6pBSZprrU2U,14679
|
|
4
4
|
huggingface_hub/_inference_endpoints.py,sha256=wzjD8P68VpUDHzIDbXzFXsM2Y-aNVSAap7BXsZFuthk,16750
|
|
@@ -17,7 +17,7 @@ huggingface_hub/fastai_utils.py,sha256=DpeH9d-6ut2k_nCAAwglM51XmRmgfbRe2SPifpVL5
|
|
|
17
17
|
huggingface_hub/file_download.py,sha256=NaHWoBHK4seUdhnx2zbtaTBK0TvTMsFqh2_gPKVTc2g,70380
|
|
18
18
|
huggingface_hub/hf_api.py,sha256=ORNYYlvHLiLRLcw2snHp6iIjv_jk15IPRL_ikw4Cc8M,422655
|
|
19
19
|
huggingface_hub/hf_file_system.py,sha256=m_g7uYLGxTdsBnhvR5835jvYMAuEBsUSFvEbzZKzzoo,47500
|
|
20
|
-
huggingface_hub/hub_mixin.py,sha256
|
|
20
|
+
huggingface_hub/hub_mixin.py,sha256=-oTnuB3b-0WeutZ1iBkAy1YuWrBKvHBVBpmd3-7oGB4,37419
|
|
21
21
|
huggingface_hub/inference_api.py,sha256=b4-NhPSn9b44nYKV8tDKXodmE4JVdEymMWL4CVGkzlE,8323
|
|
22
22
|
huggingface_hub/keras_mixin.py,sha256=3d2oW35SALXHq-WHoLD_tbq0UrcabGKj3HidtPRx51U,19574
|
|
23
23
|
huggingface_hub/lfs.py,sha256=n-TIjK7J7aXG3zi__0nkd6aNkE4djOf9CD6dYQOQ5P8,16649
|
|
@@ -46,7 +46,7 @@ huggingface_hub/inference/_generated/_async_client.py,sha256=sV3fcN2HQUquwU8N9Ag
|
|
|
46
46
|
huggingface_hub/inference/_generated/types/__init__.py,sha256=IOp7v252gLZbFb7MUCjDSvzwchycZqUo2gZPrpSDtV8,6211
|
|
47
47
|
huggingface_hub/inference/_generated/types/audio_classification.py,sha256=U340ccLtMjqRMtD3hviXCQaWk_DWJgQWor8vLgW_GKM,1552
|
|
48
48
|
huggingface_hub/inference/_generated/types/audio_to_audio.py,sha256=n7GeCepzt254yoSLsdjrI1j4fzYgjWzxoaKE5gZJc48,881
|
|
49
|
-
huggingface_hub/inference/_generated/types/automatic_speech_recognition.py,sha256=
|
|
49
|
+
huggingface_hub/inference/_generated/types/automatic_speech_recognition.py,sha256=g5L2LasOLPW49ik69SlUu-EVdNn7IWWpmGhaP9b-en0,5582
|
|
50
50
|
huggingface_hub/inference/_generated/types/base.py,sha256=dQ-ej4weVueTJQXaDFLYFhKvlCUYVH2k9r-Ck0uhFIU,5870
|
|
51
51
|
huggingface_hub/inference/_generated/types/chat_completion.py,sha256=6QKg0upzaNTv5esWfRZbtYixNrcsvGNrUpPw1mNezQ8,9589
|
|
52
52
|
huggingface_hub/inference/_generated/types/depth_estimation.py,sha256=3ZUI2w3J-WgDDxlRQ_444r46TlFRhHBt2LN2LLVJB-w,919
|
|
@@ -56,7 +56,7 @@ huggingface_hub/inference/_generated/types/fill_mask.py,sha256=fxYjJgERCwKS-LUc3
|
|
|
56
56
|
huggingface_hub/inference/_generated/types/image_classification.py,sha256=hCvz1MpMVXY3KlVENmq1Ygn4SsbE9UngPH9Y7Nj_kgg,1564
|
|
57
57
|
huggingface_hub/inference/_generated/types/image_segmentation.py,sha256=4T0rj-wGJnmqvbcj7kVt_L_mhWjEpjFH9o0VhHXaGRs,1929
|
|
58
58
|
huggingface_hub/inference/_generated/types/image_to_image.py,sha256=ZJnOADT1UE0kuBJxiA4ITTjQmp0PI4p3DcNoWRzSwkE,1945
|
|
59
|
-
huggingface_hub/inference/_generated/types/image_to_text.py,sha256=
|
|
59
|
+
huggingface_hub/inference/_generated/types/image_to_text.py,sha256=kocfj5jn_sPDk5FSR_PGl4Xq72BNHOwHEKCP3wv2poY,4887
|
|
60
60
|
huggingface_hub/inference/_generated/types/object_detection.py,sha256=eS3bbkpdtjLu2k2TjlEvLjVtMI5OdHJK1jq3kTzVZdQ,1968
|
|
61
61
|
huggingface_hub/inference/_generated/types/question_answering.py,sha256=Dzpwz3KWq3uQuzIwMRbUxSHscpLsVOPjwrKVqLJR5vA,2866
|
|
62
62
|
huggingface_hub/inference/_generated/types/sentence_similarity.py,sha256=y3KHkCYxn1tOEPrOQ6DNqQtCEhNNtGEN5aMstiQ6hVA,1042
|
|
@@ -65,9 +65,9 @@ huggingface_hub/inference/_generated/types/table_question_answering.py,sha256=YL
|
|
|
65
65
|
huggingface_hub/inference/_generated/types/text2text_generation.py,sha256=dqwTt-i-k6jo9DdGUS5ZRtrkLTVWoje3L5C3-pMv45Q,1588
|
|
66
66
|
huggingface_hub/inference/_generated/types/text_classification.py,sha256=j-0g3Ajaxg4e5TQlNs3UqVryvp5delYm8znrgzvkW-8,1424
|
|
67
67
|
huggingface_hub/inference/_generated/types/text_generation.py,sha256=TKJb26T03Gyw3As0IXmRzAritNeKUpturKfO_2OenzA,5798
|
|
68
|
-
huggingface_hub/inference/_generated/types/text_to_audio.py,sha256=
|
|
68
|
+
huggingface_hub/inference/_generated/types/text_to_audio.py,sha256=y5pT8-hWr1CK1Zxi0LPcfNbk2Mr0_DdfpRKRP1jSNts,4879
|
|
69
69
|
huggingface_hub/inference/_generated/types/text_to_image.py,sha256=DsCku9u8MaXdkkOvPqjYwHZgeCfI4HbGB8vRsPc7uUE,1984
|
|
70
|
-
huggingface_hub/inference/_generated/types/text_to_speech.py,sha256=
|
|
70
|
+
huggingface_hub/inference/_generated/types/text_to_speech.py,sha256=Kc42sG1ybdhHn7Jo-t69FqVCxQ7aBhPnjh_4HyuEjW0,4937
|
|
71
71
|
huggingface_hub/inference/_generated/types/token_classification.py,sha256=C0K5OukrNTyvZE-AdIbblacTtyc1Ita374bwfNw2Y-8,1894
|
|
72
72
|
huggingface_hub/inference/_generated/types/translation.py,sha256=AYfr0n-o0HsK21QNs0HMufI1wCMbtRhAZvNK40hjAYk,1742
|
|
73
73
|
huggingface_hub/inference/_generated/types/video_classification.py,sha256=e6J5BNqQ5gtyHAuVB-UPo4RYy4AIT6XSShhGA13CB_E,1659
|
|
@@ -109,9 +109,9 @@ huggingface_hub/utils/insecure_hashlib.py,sha256=OjxlvtSQHpbLp9PWSrXBDJ0wHjxCBU-
|
|
|
109
109
|
huggingface_hub/utils/logging.py,sha256=Cp03s0uEl3kDM9XHQW9a8GAoExODQ-e7kEtgMt-_To8,4728
|
|
110
110
|
huggingface_hub/utils/sha.py,sha256=OFnNGCba0sNcT2gUwaVCJnldxlltrHHe0DS_PCpV3C4,2134
|
|
111
111
|
huggingface_hub/utils/tqdm.py,sha256=ZgdphuTnwAIaUKnnD2P7qVvNHpzHAyrYoItkiV0aEjQ,9835
|
|
112
|
-
huggingface_hub-0.27.
|
|
113
|
-
huggingface_hub-0.27.
|
|
114
|
-
huggingface_hub-0.27.
|
|
115
|
-
huggingface_hub-0.27.
|
|
116
|
-
huggingface_hub-0.27.
|
|
117
|
-
huggingface_hub-0.27.
|
|
112
|
+
huggingface_hub-0.27.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
113
|
+
huggingface_hub-0.27.1.dist-info/METADATA,sha256=ugOT6lKz2boIscwMCbaEKc5rf_tr-S-QWjau_LD6c8Y,13480
|
|
114
|
+
huggingface_hub-0.27.1.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
115
|
+
huggingface_hub-0.27.1.dist-info/entry_points.txt,sha256=Y3Z2L02rBG7va_iE6RPXolIgwOdwUFONyRN3kXMxZ0g,131
|
|
116
|
+
huggingface_hub-0.27.1.dist-info/top_level.txt,sha256=8KzlQJAY4miUvjAssOAJodqKOw3harNzuiwGQ9qLSSk,16
|
|
117
|
+
huggingface_hub-0.27.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|