huggingface-hub 0.26.3__py3-none-any.whl → 0.27.0rc1__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 +49 -23
- huggingface_hub/_commit_scheduler.py +30 -4
- huggingface_hub/_local_folder.py +0 -4
- huggingface_hub/_login.py +38 -54
- huggingface_hub/_snapshot_download.py +6 -3
- huggingface_hub/_tensorboard_logger.py +2 -3
- huggingface_hub/_upload_large_folder.py +1 -1
- huggingface_hub/errors.py +19 -0
- huggingface_hub/fastai_utils.py +3 -2
- huggingface_hub/file_download.py +10 -12
- huggingface_hub/hf_api.py +102 -498
- huggingface_hub/hf_file_system.py +274 -35
- huggingface_hub/hub_mixin.py +5 -25
- huggingface_hub/inference/_client.py +185 -136
- huggingface_hub/inference/_common.py +2 -2
- huggingface_hub/inference/_generated/_async_client.py +186 -137
- huggingface_hub/inference/_generated/types/__init__.py +31 -10
- huggingface_hub/inference/_generated/types/audio_classification.py +3 -5
- huggingface_hub/inference/_generated/types/automatic_speech_recognition.py +6 -9
- huggingface_hub/inference/_generated/types/chat_completion.py +8 -5
- huggingface_hub/inference/_generated/types/depth_estimation.py +1 -1
- huggingface_hub/inference/_generated/types/document_question_answering.py +2 -6
- huggingface_hub/inference/_generated/types/feature_extraction.py +1 -1
- huggingface_hub/inference/_generated/types/fill_mask.py +2 -4
- huggingface_hub/inference/_generated/types/image_classification.py +3 -5
- huggingface_hub/inference/_generated/types/image_segmentation.py +2 -4
- huggingface_hub/inference/_generated/types/image_to_image.py +2 -4
- huggingface_hub/inference/_generated/types/image_to_text.py +6 -9
- huggingface_hub/inference/_generated/types/object_detection.py +2 -4
- huggingface_hub/inference/_generated/types/question_answering.py +2 -4
- huggingface_hub/inference/_generated/types/sentence_similarity.py +1 -1
- huggingface_hub/inference/_generated/types/summarization.py +2 -4
- huggingface_hub/inference/_generated/types/table_question_answering.py +21 -3
- huggingface_hub/inference/_generated/types/text2text_generation.py +2 -4
- huggingface_hub/inference/_generated/types/text_classification.py +4 -10
- huggingface_hub/inference/_generated/types/text_to_audio.py +7 -10
- huggingface_hub/inference/_generated/types/text_to_image.py +2 -4
- huggingface_hub/inference/_generated/types/text_to_speech.py +7 -10
- huggingface_hub/inference/_generated/types/token_classification.py +11 -12
- huggingface_hub/inference/_generated/types/translation.py +2 -4
- huggingface_hub/inference/_generated/types/video_classification.py +3 -4
- huggingface_hub/inference/_generated/types/visual_question_answering.py +2 -5
- huggingface_hub/inference/_generated/types/zero_shot_classification.py +8 -18
- huggingface_hub/inference/_generated/types/zero_shot_image_classification.py +9 -19
- huggingface_hub/inference/_generated/types/zero_shot_object_detection.py +7 -9
- huggingface_hub/keras_mixin.py +3 -2
- huggingface_hub/lfs.py +2 -5
- huggingface_hub/repocard_data.py +4 -4
- huggingface_hub/serialization/__init__.py +2 -0
- huggingface_hub/serialization/_dduf.py +387 -0
- huggingface_hub/serialization/_torch.py +407 -25
- huggingface_hub/utils/_cache_manager.py +1 -1
- huggingface_hub/utils/_headers.py +9 -25
- huggingface_hub/utils/tqdm.py +15 -0
- {huggingface_hub-0.26.3.dist-info → huggingface_hub-0.27.0rc1.dist-info}/METADATA +8 -3
- {huggingface_hub-0.26.3.dist-info → huggingface_hub-0.27.0rc1.dist-info}/RECORD +60 -60
- huggingface_hub/_multi_commits.py +0 -306
- {huggingface_hub-0.26.3.dist-info → huggingface_hub-0.27.0rc1.dist-info}/LICENSE +0 -0
- {huggingface_hub-0.26.3.dist-info → huggingface_hub-0.27.0rc1.dist-info}/WHEEL +0 -0
- {huggingface_hub-0.26.3.dist-info → huggingface_hub-0.27.0rc1.dist-info}/entry_points.txt +0 -0
- {huggingface_hub-0.26.3.dist-info → huggingface_hub-0.27.0rc1.dist-info}/top_level.txt +0 -0
|
@@ -81,7 +81,7 @@ logger = logging.getLogger(__name__)
|
|
|
81
81
|
@dataclass
|
|
82
82
|
class ModelStatus:
|
|
83
83
|
"""
|
|
84
|
-
This Dataclass represents the
|
|
84
|
+
This Dataclass represents the model status in the Hugging Face Inference API.
|
|
85
85
|
|
|
86
86
|
Args:
|
|
87
87
|
loaded (`bool`):
|
|
@@ -213,7 +213,7 @@ def _open_as_binary(content: Optional[ContentT]) -> Generator[Optional[BinaryT],
|
|
|
213
213
|
|
|
214
214
|
|
|
215
215
|
def _b64_encode(content: ContentT) -> str:
|
|
216
|
-
"""Encode a raw file (image, audio) into base64. Can be
|
|
216
|
+
"""Encode a raw file (image, audio) into base64. Can be bytes, an opened file, a path or a URL."""
|
|
217
217
|
with _open_as_binary(content) as data:
|
|
218
218
|
data_as_bytes = data if isinstance(data, bytes) else data.read()
|
|
219
219
|
return base64.b64encode(data_as_bytes).decode()
|