huggingface-hub 0.25.0__tar.gz → 0.25.0rc0__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.25.0 → huggingface_hub-0.25.0rc0}/PKG-INFO +1 -1
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/__init__.py +1 -1
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/_upload_large_folder.py +11 -59
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/hf_api.py +3 -28
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub.egg-info/PKG-INFO +1 -1
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/LICENSE +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/MANIFEST.in +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/README.md +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/pyproject.toml +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/setup.cfg +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/setup.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/_commit_api.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/_commit_scheduler.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/_inference_endpoints.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/_local_folder.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/_login.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/_multi_commits.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/_snapshot_download.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/_space_api.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/_tensorboard_logger.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/_webhooks_payload.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/_webhooks_server.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/commands/__init__.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/commands/_cli_utils.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/commands/delete_cache.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/commands/download.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/commands/env.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/commands/huggingface_cli.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/commands/lfs.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/commands/repo_files.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/commands/scan_cache.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/commands/tag.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/commands/upload.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/commands/upload_large_folder.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/commands/user.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/commands/version.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/community.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/constants.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/errors.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/fastai_utils.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/file_download.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/hf_file_system.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/hub_mixin.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/inference/__init__.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/inference/_client.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/inference/_common.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/inference/_generated/__init__.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/inference/_generated/_async_client.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/inference/_generated/types/__init__.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/inference/_generated/types/audio_classification.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/inference/_generated/types/audio_to_audio.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/inference/_generated/types/automatic_speech_recognition.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/inference/_generated/types/base.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/inference/_generated/types/chat_completion.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/inference/_generated/types/depth_estimation.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/inference/_generated/types/document_question_answering.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/inference/_generated/types/feature_extraction.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/inference/_generated/types/fill_mask.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/inference/_generated/types/image_classification.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/inference/_generated/types/image_segmentation.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/inference/_generated/types/image_to_image.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/inference/_generated/types/image_to_text.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/inference/_generated/types/object_detection.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/inference/_generated/types/question_answering.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/inference/_generated/types/sentence_similarity.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/inference/_generated/types/summarization.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/inference/_generated/types/table_question_answering.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/inference/_generated/types/text2text_generation.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/inference/_generated/types/text_classification.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/inference/_generated/types/text_generation.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/inference/_generated/types/text_to_audio.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/inference/_generated/types/text_to_image.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/inference/_generated/types/token_classification.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/inference/_generated/types/translation.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/inference/_generated/types/video_classification.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/inference/_generated/types/visual_question_answering.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/inference/_generated/types/zero_shot_classification.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/inference/_generated/types/zero_shot_image_classification.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/inference/_generated/types/zero_shot_object_detection.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/inference/_templating.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/inference_api.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/keras_mixin.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/lfs.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/repocard.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/repocard_data.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/repository.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/serialization/__init__.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/serialization/_base.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/serialization/_tensorflow.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/serialization/_torch.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/templates/datasetcard_template.md +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/templates/modelcard_template.md +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/utils/__init__.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/utils/_cache_assets.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/utils/_cache_manager.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/utils/_chunk_utils.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/utils/_datetime.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/utils/_deprecation.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/utils/_experimental.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/utils/_fixes.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/utils/_git_credential.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/utils/_headers.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/utils/_hf_folder.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/utils/_http.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/utils/_lfs.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/utils/_pagination.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/utils/_paths.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/utils/_runtime.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/utils/_safetensors.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/utils/_subprocess.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/utils/_telemetry.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/utils/_token.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/utils/_typing.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/utils/_validators.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/utils/endpoint_helpers.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/utils/insecure_hashlib.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/utils/logging.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/utils/sha.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/utils/tqdm.py +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub.egg-info/SOURCES.txt +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub.egg-info/dependency_links.txt +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub.egg-info/entry_points.txt +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub.egg-info/requires.txt +0 -0
- {huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/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.25.
|
|
3
|
+
Version: 0.25.0rc0
|
|
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.
|
{huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/_upload_large_folder.py
RENAMED
|
@@ -41,8 +41,6 @@ if TYPE_CHECKING:
|
|
|
41
41
|
logger = logging.getLogger(__name__)
|
|
42
42
|
|
|
43
43
|
WAITING_TIME_IF_NO_TASKS = 10 # seconds
|
|
44
|
-
MAX_NB_REGULAR_FILES_PER_COMMIT = 75
|
|
45
|
-
MAX_NB_LFS_FILES_PER_COMMIT = 150
|
|
46
44
|
|
|
47
45
|
|
|
48
46
|
def upload_large_folder_internal(
|
|
@@ -375,18 +373,17 @@ def _determine_next_job(status: LargeUploadStatus) -> Optional[Tuple[WorkerJob,
|
|
|
375
373
|
if (
|
|
376
374
|
status.nb_workers_commit == 0
|
|
377
375
|
and status.queue_commit.qsize() > 0
|
|
378
|
-
and status.last_commit_attempt is
|
|
379
|
-
and time.time() - status.last_commit_attempt > 5 * 60
|
|
376
|
+
and (status.last_commit_attempt is None or time.time() - status.last_commit_attempt > 5 * 60)
|
|
380
377
|
):
|
|
381
378
|
status.nb_workers_commit += 1
|
|
382
379
|
logger.debug("Job: commit (more than 5 minutes since last commit attempt)")
|
|
383
|
-
return (WorkerJob.COMMIT,
|
|
380
|
+
return (WorkerJob.COMMIT, _get_n(status.queue_commit, 25))
|
|
384
381
|
|
|
385
|
-
# 2. Commit if at least
|
|
386
|
-
elif status.nb_workers_commit == 0 and status.queue_commit.qsize() >=
|
|
382
|
+
# 2. Commit if at least 25 files are ready to commit
|
|
383
|
+
elif status.nb_workers_commit == 0 and status.queue_commit.qsize() >= 25:
|
|
387
384
|
status.nb_workers_commit += 1
|
|
388
|
-
logger.debug("Job: commit (>
|
|
389
|
-
return (WorkerJob.COMMIT,
|
|
385
|
+
logger.debug("Job: commit (>25 files ready)")
|
|
386
|
+
return (WorkerJob.COMMIT, _get_n(status.queue_commit, 25))
|
|
390
387
|
|
|
391
388
|
# 3. Get upload mode if at least 10 files
|
|
392
389
|
elif status.queue_get_upload_mode.qsize() >= 10:
|
|
@@ -433,39 +430,18 @@ def _determine_next_job(status: LargeUploadStatus) -> Optional[Tuple[WorkerJob,
|
|
|
433
430
|
logger.debug("Job: get upload mode")
|
|
434
431
|
return (WorkerJob.GET_UPLOAD_MODE, _get_n(status.queue_get_upload_mode, 50))
|
|
435
432
|
|
|
436
|
-
# 10. Commit if at least 1 file
|
|
437
|
-
elif (
|
|
438
|
-
status.nb_workers_commit == 0
|
|
439
|
-
and status.queue_commit.qsize() > 0
|
|
440
|
-
and status.last_commit_attempt is not None
|
|
441
|
-
and time.time() - status.last_commit_attempt > 1 * 60
|
|
442
|
-
):
|
|
443
|
-
status.nb_workers_commit += 1
|
|
444
|
-
logger.debug("Job: commit (1 min since last commit attempt)")
|
|
445
|
-
return (WorkerJob.COMMIT, _get_items_to_commit(status.queue_commit))
|
|
446
|
-
|
|
447
|
-
# 11. Commit if at least 1 file all other queues are empty and all workers are waiting
|
|
448
|
-
# e.g. when it's the last commit
|
|
449
|
-
elif (
|
|
450
|
-
status.nb_workers_commit == 0
|
|
451
|
-
and status.queue_commit.qsize() > 0
|
|
452
|
-
and status.queue_sha256.qsize() == 0
|
|
453
|
-
and status.queue_get_upload_mode.qsize() == 0
|
|
454
|
-
and status.queue_preupload_lfs.qsize() == 0
|
|
455
|
-
and status.nb_workers_sha256 == 0
|
|
456
|
-
and status.nb_workers_get_upload_mode == 0
|
|
457
|
-
and status.nb_workers_preupload_lfs == 0
|
|
458
|
-
):
|
|
433
|
+
# 10. Commit if at least 1 file
|
|
434
|
+
elif status.nb_workers_commit == 0 and status.queue_commit.qsize() > 0:
|
|
459
435
|
status.nb_workers_commit += 1
|
|
460
436
|
logger.debug("Job: commit")
|
|
461
|
-
return (WorkerJob.COMMIT,
|
|
437
|
+
return (WorkerJob.COMMIT, _get_n(status.queue_commit, 25))
|
|
462
438
|
|
|
463
|
-
#
|
|
439
|
+
# 11. If all queues are empty, exit
|
|
464
440
|
elif all(metadata.is_committed or metadata.should_ignore for _, metadata in status.items):
|
|
465
441
|
logger.info("All files have been processed! Exiting worker.")
|
|
466
442
|
return None
|
|
467
443
|
|
|
468
|
-
#
|
|
444
|
+
# 12. If no task is available, wait
|
|
469
445
|
else:
|
|
470
446
|
status.nb_workers_waiting += 1
|
|
471
447
|
logger.debug(f"No task available, waiting... ({WAITING_TIME_IF_NO_TASKS}s)")
|
|
@@ -571,30 +547,6 @@ def _get_n(queue: "queue.Queue[JOB_ITEM_T]", n: int) -> List[JOB_ITEM_T]:
|
|
|
571
547
|
return [queue.get() for _ in range(min(queue.qsize(), n))]
|
|
572
548
|
|
|
573
549
|
|
|
574
|
-
def _get_items_to_commit(queue: "queue.Queue[JOB_ITEM_T]") -> List[JOB_ITEM_T]:
|
|
575
|
-
"""Special case for commit job: the number of items to commit depends on the type of files."""
|
|
576
|
-
# Can take at most 50 regular files and/or 100 LFS files in a single commit
|
|
577
|
-
items: List[JOB_ITEM_T] = []
|
|
578
|
-
nb_lfs, nb_regular = 0, 0
|
|
579
|
-
while True:
|
|
580
|
-
# If empty queue => commit everything
|
|
581
|
-
if queue.qsize() == 0:
|
|
582
|
-
return items
|
|
583
|
-
|
|
584
|
-
# If we have enough items => commit them
|
|
585
|
-
if nb_lfs >= MAX_NB_LFS_FILES_PER_COMMIT or nb_regular >= MAX_NB_REGULAR_FILES_PER_COMMIT:
|
|
586
|
-
return items
|
|
587
|
-
|
|
588
|
-
# Else, get a new item and increase counter
|
|
589
|
-
item = queue.get()
|
|
590
|
-
items.append(item)
|
|
591
|
-
_, metadata = item
|
|
592
|
-
if metadata.upload_mode == "lfs":
|
|
593
|
-
nb_lfs += 1
|
|
594
|
-
else:
|
|
595
|
-
nb_regular += 1
|
|
596
|
-
|
|
597
|
-
|
|
598
550
|
def _print_overwrite(report: str) -> None:
|
|
599
551
|
"""Print a report, overwriting the previous lines.
|
|
600
552
|
|
|
@@ -136,7 +136,6 @@ from .utils import (
|
|
|
136
136
|
validate_hf_hub_args,
|
|
137
137
|
)
|
|
138
138
|
from .utils import tqdm as hf_tqdm
|
|
139
|
-
from .utils._deprecation import _deprecate_method
|
|
140
139
|
from .utils._typing import CallableT
|
|
141
140
|
from .utils.endpoint_helpers import _is_emission_within_threshold
|
|
142
141
|
|
|
@@ -1406,10 +1405,6 @@ class User:
|
|
|
1406
1405
|
Number of upvotes received by the user.
|
|
1407
1406
|
num_likes (`int`, *optional*):
|
|
1408
1407
|
Number of likes given by the user.
|
|
1409
|
-
num_following (`int`, *optional*):
|
|
1410
|
-
Number of users this user is following.
|
|
1411
|
-
num_followers (`int`, *optional*):
|
|
1412
|
-
Number of users following this user.
|
|
1413
1408
|
orgs (list of [`Organization`]):
|
|
1414
1409
|
List of organizations the user is part of.
|
|
1415
1410
|
"""
|
|
@@ -1428,8 +1423,6 @@ class User:
|
|
|
1428
1423
|
num_papers: Optional[int] = None
|
|
1429
1424
|
num_upvotes: Optional[int] = None
|
|
1430
1425
|
num_likes: Optional[int] = None
|
|
1431
|
-
num_following: Optional[int] = None
|
|
1432
|
-
num_followers: Optional[int] = None
|
|
1433
1426
|
orgs: List[Organization] = field(default_factory=list)
|
|
1434
1427
|
|
|
1435
1428
|
def __init__(self, **kwargs) -> None:
|
|
@@ -1446,8 +1439,6 @@ class User:
|
|
|
1446
1439
|
self.num_papers = kwargs.pop("numPapers", None)
|
|
1447
1440
|
self.num_upvotes = kwargs.pop("numUpvotes", None)
|
|
1448
1441
|
self.num_likes = kwargs.pop("numLikes", None)
|
|
1449
|
-
self.num_following = kwargs.pop("numFollowing", None)
|
|
1450
|
-
self.num_followers = kwargs.pop("numFollowers", None)
|
|
1451
1442
|
self.user_type = kwargs.pop("type", None)
|
|
1452
1443
|
self.orgs = [Organization(**org) for org in kwargs.pop("orgs", [])]
|
|
1453
1444
|
|
|
@@ -4019,9 +4010,6 @@ class HfApi:
|
|
|
4019
4010
|
|
|
4020
4011
|
@experimental
|
|
4021
4012
|
@validate_hf_hub_args
|
|
4022
|
-
@_deprecate_method(
|
|
4023
|
-
version="0.27", message="This is an experimental feature. Please use `upload_large_folder` instead."
|
|
4024
|
-
)
|
|
4025
4013
|
def create_commits_on_pr(
|
|
4026
4014
|
self,
|
|
4027
4015
|
*,
|
|
@@ -4860,10 +4848,8 @@ class HfApi:
|
|
|
4860
4848
|
new files. This is useful if you don't know which files have already been uploaded.
|
|
4861
4849
|
Note: to avoid discrepancies the `.gitattributes` file is not deleted even if it matches the pattern.
|
|
4862
4850
|
multi_commits (`bool`):
|
|
4863
|
-
Deprecated. For large uploads, use `upload_large_folder` instead.
|
|
4864
4851
|
If True, changes are pushed to a PR using a multi-commit process. Defaults to `False`.
|
|
4865
4852
|
multi_commits_verbose (`bool`):
|
|
4866
|
-
Deprecated. For large uploads, use `upload_large_folder` instead.
|
|
4867
4853
|
If True and `multi_commits` is used, more information will be displayed to the user.
|
|
4868
4854
|
run_as_future (`bool`, *optional*):
|
|
4869
4855
|
Whether or not to run this method in the background. Background jobs are run sequentially without
|
|
@@ -5356,7 +5342,7 @@ class HfApi:
|
|
|
5356
5342
|
|
|
5357
5343
|
Order of priority:
|
|
5358
5344
|
1. Commit if more than 5 minutes since last commit attempt (and at least 1 file).
|
|
5359
|
-
2. Commit if at least
|
|
5345
|
+
2. Commit if at least 25 files are ready to commit.
|
|
5360
5346
|
3. Get upload mode if at least 10 files have been hashed.
|
|
5361
5347
|
4. Pre-upload LFS file if at least 1 file and no worker is pre-uploading.
|
|
5362
5348
|
5. Hash file if at least 1 file and no worker is hashing.
|
|
@@ -5364,8 +5350,7 @@ class HfApi:
|
|
|
5364
5350
|
7. Pre-upload LFS file if at least 1 file (exception: if hf_transfer is enabled, only 1 worker can preupload LFS at a time).
|
|
5365
5351
|
8. Hash file if at least 1 file to hash.
|
|
5366
5352
|
9. Get upload mode if at least 1 file to get upload mode.
|
|
5367
|
-
10. Commit if at least 1 file to commit
|
|
5368
|
-
11. Commit if at least 1 file to commit and all other queues are empty.
|
|
5353
|
+
10. Commit if at least 1 file to commit.
|
|
5369
5354
|
|
|
5370
5355
|
Special rules:
|
|
5371
5356
|
- If `hf_transfer` is enabled, only 1 LFS uploader at a time. Otherwise the CPU would be bloated by `hf_transfer`.
|
|
@@ -9478,24 +9463,14 @@ class HfApi:
|
|
|
9478
9463
|
repo_type=repo_type,
|
|
9479
9464
|
token=token,
|
|
9480
9465
|
)
|
|
9481
|
-
if len(filtered_repo_objects) > 30:
|
|
9482
|
-
logger.info(
|
|
9483
|
-
"It seems you are trying to upload a large folder at once. This might take some time and then fail if "
|
|
9484
|
-
"the folder is too large. For such cases, it is recommended to upload in smaller batches or to use "
|
|
9485
|
-
"`HfApi().upload_large_folder(...)`/`huggingface-cli upload-large-folder` instead. For more details, "
|
|
9486
|
-
"check out https://huggingface.co/docs/huggingface_hub/main/en/guides/upload#upload-a-large-folder."
|
|
9487
|
-
)
|
|
9488
9466
|
|
|
9489
|
-
|
|
9490
|
-
operations = [
|
|
9467
|
+
return [
|
|
9491
9468
|
CommitOperationAdd(
|
|
9492
9469
|
path_or_fileobj=relpath_to_abspath[relpath], # absolute path on disk
|
|
9493
9470
|
path_in_repo=prefix + relpath, # "absolute" path in repo
|
|
9494
9471
|
)
|
|
9495
9472
|
for relpath in filtered_repo_objects
|
|
9496
9473
|
]
|
|
9497
|
-
logger.info(f"Finished hashing {len(filtered_repo_objects)} files.")
|
|
9498
|
-
return operations
|
|
9499
9474
|
|
|
9500
9475
|
def _validate_yaml(self, content: str, *, repo_type: Optional[str] = None, token: Union[bool, str, None] = None):
|
|
9501
9476
|
"""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: huggingface-hub
|
|
3
|
-
Version: 0.25.
|
|
3
|
+
Version: 0.25.0rc0
|
|
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
|
{huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/_commit_scheduler.py
RENAMED
|
File without changes
|
{huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/_inference_endpoints.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/_snapshot_download.py
RENAMED
|
File without changes
|
|
File without changes
|
{huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/_tensorboard_logger.py
RENAMED
|
File without changes
|
{huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/_webhooks_payload.py
RENAMED
|
File without changes
|
{huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/_webhooks_server.py
RENAMED
|
File without changes
|
{huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/commands/__init__.py
RENAMED
|
File without changes
|
{huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/commands/_cli_utils.py
RENAMED
|
File without changes
|
{huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/commands/delete_cache.py
RENAMED
|
File without changes
|
{huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/commands/download.py
RENAMED
|
File without changes
|
|
File without changes
|
{huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/commands/huggingface_cli.py
RENAMED
|
File without changes
|
|
File without changes
|
{huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/commands/repo_files.py
RENAMED
|
File without changes
|
{huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/commands/scan_cache.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/commands/version.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.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/inference/__init__.py
RENAMED
|
File without changes
|
{huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/inference/_client.py
RENAMED
|
File without changes
|
{huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/inference/_common.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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/inference/_templating.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/serialization/__init__.py
RENAMED
|
File without changes
|
{huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/serialization/_base.py
RENAMED
|
File without changes
|
|
File without changes
|
{huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/serialization/_torch.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/utils/_cache_assets.py
RENAMED
|
File without changes
|
{huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/utils/_cache_manager.py
RENAMED
|
File without changes
|
{huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/utils/_chunk_utils.py
RENAMED
|
File without changes
|
|
File without changes
|
{huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/utils/_deprecation.py
RENAMED
|
File without changes
|
{huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/utils/_experimental.py
RENAMED
|
File without changes
|
|
File without changes
|
{huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/utils/_git_credential.py
RENAMED
|
File without changes
|
|
File without changes
|
{huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/utils/_hf_folder.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/utils/_pagination.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/utils/_safetensors.py
RENAMED
|
File without changes
|
{huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/utils/_subprocess.py
RENAMED
|
File without changes
|
{huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/utils/_telemetry.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/utils/_validators.py
RENAMED
|
File without changes
|
{huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/utils/endpoint_helpers.py
RENAMED
|
File without changes
|
{huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub/utils/insecure_hashlib.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub.egg-info/entry_points.txt
RENAMED
|
File without changes
|
{huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub.egg-info/requires.txt
RENAMED
|
File without changes
|
{huggingface_hub-0.25.0 → huggingface_hub-0.25.0rc0}/src/huggingface_hub.egg-info/top_level.txt
RENAMED
|
File without changes
|