diff --git a/dev/chunkedcommit/.buildinfo b/dev/chunkedcommit/.buildinfo index 8b1d69d38e..9d77f5d87c 100644 --- a/dev/chunkedcommit/.buildinfo +++ b/dev/chunkedcommit/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: 4f3c2a59e92ab017ca6f9028ff4c1f93 +config: 9cebdb16c6bbddcc6ab01a1bfac1b275 tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/dev/chunkedcommit/.doctrees/api_doc/archive/index.doctree b/dev/chunkedcommit/.doctrees/api_doc/archive/index.doctree index b194e41ad0..335c2b95f1 100644 Binary files a/dev/chunkedcommit/.doctrees/api_doc/archive/index.doctree and b/dev/chunkedcommit/.doctrees/api_doc/archive/index.doctree differ diff --git a/dev/chunkedcommit/.doctrees/api_doc/cache/delete.doctree b/dev/chunkedcommit/.doctrees/api_doc/cache/delete.doctree index 972ea6037a..7e255a4b56 100644 Binary files a/dev/chunkedcommit/.doctrees/api_doc/cache/delete.doctree and b/dev/chunkedcommit/.doctrees/api_doc/cache/delete.doctree differ diff --git a/dev/chunkedcommit/.doctrees/api_doc/cache/index.doctree b/dev/chunkedcommit/.doctrees/api_doc/cache/index.doctree index 07591299a9..5dd759d166 100644 Binary files a/dev/chunkedcommit/.doctrees/api_doc/cache/index.doctree and b/dev/chunkedcommit/.doctrees/api_doc/cache/index.doctree differ diff --git a/dev/chunkedcommit/.doctrees/api_doc/config/index.doctree b/dev/chunkedcommit/.doctrees/api_doc/config/index.doctree index 8cb04b86ad..43c8d662ce 100644 Binary files a/dev/chunkedcommit/.doctrees/api_doc/config/index.doctree and b/dev/chunkedcommit/.doctrees/api_doc/config/index.doctree differ diff --git a/dev/chunkedcommit/.doctrees/api_doc/config/meta.doctree b/dev/chunkedcommit/.doctrees/api_doc/config/meta.doctree index e4c03cfe38..cbe76f446c 100644 Binary files a/dev/chunkedcommit/.doctrees/api_doc/config/meta.doctree and b/dev/chunkedcommit/.doctrees/api_doc/config/meta.doctree differ diff --git a/dev/chunkedcommit/.doctrees/api_doc/entry/base.doctree b/dev/chunkedcommit/.doctrees/api_doc/entry/base.doctree index bd70a3b3e5..04d5d1d700 100644 Binary files a/dev/chunkedcommit/.doctrees/api_doc/entry/base.doctree and b/dev/chunkedcommit/.doctrees/api_doc/entry/base.doctree differ diff --git a/dev/chunkedcommit/.doctrees/api_doc/entry/cli.doctree b/dev/chunkedcommit/.doctrees/api_doc/entry/cli.doctree index 91f1d66ca4..61b3124446 100644 Binary files a/dev/chunkedcommit/.doctrees/api_doc/entry/cli.doctree and b/dev/chunkedcommit/.doctrees/api_doc/entry/cli.doctree differ diff --git a/dev/chunkedcommit/.doctrees/api_doc/entry/dispatch.doctree b/dev/chunkedcommit/.doctrees/api_doc/entry/dispatch.doctree index ad2ea493f6..59bcc89a3d 100644 Binary files a/dev/chunkedcommit/.doctrees/api_doc/entry/dispatch.doctree and b/dev/chunkedcommit/.doctrees/api_doc/entry/dispatch.doctree differ diff --git a/dev/chunkedcommit/.doctrees/api_doc/entry/download.doctree b/dev/chunkedcommit/.doctrees/api_doc/entry/download.doctree index af33306cfd..fa7d95e605 100644 Binary files a/dev/chunkedcommit/.doctrees/api_doc/entry/download.doctree and b/dev/chunkedcommit/.doctrees/api_doc/entry/download.doctree differ diff --git a/dev/chunkedcommit/.doctrees/api_doc/entry/index.doctree b/dev/chunkedcommit/.doctrees/api_doc/entry/index.doctree index 250c93ce20..85c4543c16 100644 Binary files a/dev/chunkedcommit/.doctrees/api_doc/entry/index.doctree and b/dev/chunkedcommit/.doctrees/api_doc/entry/index.doctree differ diff --git a/dev/chunkedcommit/.doctrees/api_doc/entry/ls.doctree b/dev/chunkedcommit/.doctrees/api_doc/entry/ls.doctree index d21db2c6e8..bbb9091f27 100644 Binary files a/dev/chunkedcommit/.doctrees/api_doc/entry/ls.doctree and b/dev/chunkedcommit/.doctrees/api_doc/entry/ls.doctree differ diff --git a/dev/chunkedcommit/.doctrees/api_doc/entry/ls_repo.doctree b/dev/chunkedcommit/.doctrees/api_doc/entry/ls_repo.doctree index dc4a7f1536..1a70ce6338 100644 Binary files a/dev/chunkedcommit/.doctrees/api_doc/entry/ls_repo.doctree and b/dev/chunkedcommit/.doctrees/api_doc/entry/ls_repo.doctree differ diff --git a/dev/chunkedcommit/.doctrees/api_doc/entry/upload.doctree b/dev/chunkedcommit/.doctrees/api_doc/entry/upload.doctree index 4a634393b7..2df46a3a21 100644 Binary files a/dev/chunkedcommit/.doctrees/api_doc/entry/upload.doctree and b/dev/chunkedcommit/.doctrees/api_doc/entry/upload.doctree differ diff --git a/dev/chunkedcommit/.doctrees/api_doc/entry/whoami.doctree b/dev/chunkedcommit/.doctrees/api_doc/entry/whoami.doctree index 39aec88d77..3c87a7d74b 100644 Binary files a/dev/chunkedcommit/.doctrees/api_doc/entry/whoami.doctree and b/dev/chunkedcommit/.doctrees/api_doc/entry/whoami.doctree differ diff --git a/dev/chunkedcommit/.doctrees/api_doc/index/fetch.doctree b/dev/chunkedcommit/.doctrees/api_doc/index/fetch.doctree index 625078b944..f454745180 100644 Binary files a/dev/chunkedcommit/.doctrees/api_doc/index/fetch.doctree and b/dev/chunkedcommit/.doctrees/api_doc/index/fetch.doctree differ diff --git a/dev/chunkedcommit/.doctrees/api_doc/index/index.doctree b/dev/chunkedcommit/.doctrees/api_doc/index/index.doctree index 07b19d81d6..47fa4cdf9c 100644 Binary files a/dev/chunkedcommit/.doctrees/api_doc/index/index.doctree and b/dev/chunkedcommit/.doctrees/api_doc/index/index.doctree differ diff --git a/dev/chunkedcommit/.doctrees/api_doc/index/make.doctree b/dev/chunkedcommit/.doctrees/api_doc/index/make.doctree index 749369f0b1..d9d2384ada 100644 Binary files a/dev/chunkedcommit/.doctrees/api_doc/index/make.doctree and b/dev/chunkedcommit/.doctrees/api_doc/index/make.doctree differ diff --git a/dev/chunkedcommit/.doctrees/api_doc/index/validate.doctree b/dev/chunkedcommit/.doctrees/api_doc/index/validate.doctree index 2fe523d4c8..dcbb7e55fd 100644 Binary files a/dev/chunkedcommit/.doctrees/api_doc/index/validate.doctree and b/dev/chunkedcommit/.doctrees/api_doc/index/validate.doctree differ diff --git a/dev/chunkedcommit/.doctrees/api_doc/operate/base.doctree b/dev/chunkedcommit/.doctrees/api_doc/operate/base.doctree index bcb9135c94..d354a84c49 100644 Binary files a/dev/chunkedcommit/.doctrees/api_doc/operate/base.doctree and b/dev/chunkedcommit/.doctrees/api_doc/operate/base.doctree differ diff --git a/dev/chunkedcommit/.doctrees/api_doc/operate/download.doctree b/dev/chunkedcommit/.doctrees/api_doc/operate/download.doctree index 6ceac971ed..0a5605116d 100644 Binary files a/dev/chunkedcommit/.doctrees/api_doc/operate/download.doctree and b/dev/chunkedcommit/.doctrees/api_doc/operate/download.doctree differ diff --git a/dev/chunkedcommit/.doctrees/api_doc/operate/index.doctree b/dev/chunkedcommit/.doctrees/api_doc/operate/index.doctree index 3d9600acc6..e5f7176700 100644 Binary files a/dev/chunkedcommit/.doctrees/api_doc/operate/index.doctree and b/dev/chunkedcommit/.doctrees/api_doc/operate/index.doctree differ diff --git a/dev/chunkedcommit/.doctrees/api_doc/operate/upload.doctree b/dev/chunkedcommit/.doctrees/api_doc/operate/upload.doctree index 585837ab30..75abd2616a 100644 Binary files a/dev/chunkedcommit/.doctrees/api_doc/operate/upload.doctree and b/dev/chunkedcommit/.doctrees/api_doc/operate/upload.doctree differ diff --git a/dev/chunkedcommit/.doctrees/api_doc/operate/validate.doctree b/dev/chunkedcommit/.doctrees/api_doc/operate/validate.doctree index fe4c8291eb..c1f5ea5840 100644 Binary files a/dev/chunkedcommit/.doctrees/api_doc/operate/validate.doctree and b/dev/chunkedcommit/.doctrees/api_doc/operate/validate.doctree differ diff --git a/dev/chunkedcommit/.doctrees/api_doc/repository/base.doctree b/dev/chunkedcommit/.doctrees/api_doc/repository/base.doctree index 2f55726149..dbb340018b 100644 Binary files a/dev/chunkedcommit/.doctrees/api_doc/repository/base.doctree and b/dev/chunkedcommit/.doctrees/api_doc/repository/base.doctree differ diff --git a/dev/chunkedcommit/.doctrees/api_doc/repository/clone.doctree b/dev/chunkedcommit/.doctrees/api_doc/repository/clone.doctree index bc87659e8a..1b94f2509a 100644 Binary files a/dev/chunkedcommit/.doctrees/api_doc/repository/clone.doctree and b/dev/chunkedcommit/.doctrees/api_doc/repository/clone.doctree differ diff --git a/dev/chunkedcommit/.doctrees/api_doc/repository/index.doctree b/dev/chunkedcommit/.doctrees/api_doc/repository/index.doctree index 5a0572470c..a977c4f010 100644 Binary files a/dev/chunkedcommit/.doctrees/api_doc/repository/index.doctree and b/dev/chunkedcommit/.doctrees/api_doc/repository/index.doctree differ diff --git a/dev/chunkedcommit/.doctrees/api_doc/repository/rollback.doctree b/dev/chunkedcommit/.doctrees/api_doc/repository/rollback.doctree index 7685c3c82c..ab11389782 100644 Binary files a/dev/chunkedcommit/.doctrees/api_doc/repository/rollback.doctree and b/dev/chunkedcommit/.doctrees/api_doc/repository/rollback.doctree differ diff --git a/dev/chunkedcommit/.doctrees/api_doc/utils/binary.doctree b/dev/chunkedcommit/.doctrees/api_doc/utils/binary.doctree index 8c24bf0045..b839d34e72 100644 Binary files a/dev/chunkedcommit/.doctrees/api_doc/utils/binary.doctree and b/dev/chunkedcommit/.doctrees/api_doc/utils/binary.doctree differ diff --git a/dev/chunkedcommit/.doctrees/api_doc/utils/download.doctree b/dev/chunkedcommit/.doctrees/api_doc/utils/download.doctree index e599fa1ad6..5a482bbd42 100644 Binary files a/dev/chunkedcommit/.doctrees/api_doc/utils/download.doctree and b/dev/chunkedcommit/.doctrees/api_doc/utils/download.doctree differ diff --git a/dev/chunkedcommit/.doctrees/api_doc/utils/index.doctree b/dev/chunkedcommit/.doctrees/api_doc/utils/index.doctree index 6045cb0a94..f49d24057d 100644 Binary files a/dev/chunkedcommit/.doctrees/api_doc/utils/index.doctree and b/dev/chunkedcommit/.doctrees/api_doc/utils/index.doctree differ diff --git a/dev/chunkedcommit/.doctrees/api_doc/utils/path.doctree b/dev/chunkedcommit/.doctrees/api_doc/utils/path.doctree index aecb97125e..8e51d4ccb6 100644 Binary files a/dev/chunkedcommit/.doctrees/api_doc/utils/path.doctree and b/dev/chunkedcommit/.doctrees/api_doc/utils/path.doctree differ diff --git a/dev/chunkedcommit/.doctrees/api_doc/utils/tqdm_.doctree b/dev/chunkedcommit/.doctrees/api_doc/utils/tqdm_.doctree index e2adb343c1..191c9b7fdf 100644 Binary files a/dev/chunkedcommit/.doctrees/api_doc/utils/tqdm_.doctree and b/dev/chunkedcommit/.doctrees/api_doc/utils/tqdm_.doctree differ diff --git a/dev/chunkedcommit/.doctrees/api_doc/utils/walk.doctree b/dev/chunkedcommit/.doctrees/api_doc/utils/walk.doctree index 7ee06d8b1c..f05993d462 100644 Binary files a/dev/chunkedcommit/.doctrees/api_doc/utils/walk.doctree and b/dev/chunkedcommit/.doctrees/api_doc/utils/walk.doctree differ diff --git a/dev/chunkedcommit/.doctrees/environment.pickle b/dev/chunkedcommit/.doctrees/environment.pickle index 8470b3832a..e6f7c092ca 100644 Binary files a/dev/chunkedcommit/.doctrees/environment.pickle and b/dev/chunkedcommit/.doctrees/environment.pickle differ diff --git a/dev/chunkedcommit/.doctrees/index.doctree b/dev/chunkedcommit/.doctrees/index.doctree index f8a17ee54d..9c28d9467c 100644 Binary files a/dev/chunkedcommit/.doctrees/index.doctree and b/dev/chunkedcommit/.doctrees/index.doctree differ diff --git a/dev/chunkedcommit/.doctrees/information/environment.doctree b/dev/chunkedcommit/.doctrees/information/environment.doctree index 708ea03558..0c40ac59b6 100644 Binary files a/dev/chunkedcommit/.doctrees/information/environment.doctree and b/dev/chunkedcommit/.doctrees/information/environment.doctree differ diff --git a/dev/chunkedcommit/.doctrees/information/environment.result.doctree b/dev/chunkedcommit/.doctrees/information/environment.result.doctree index eb6941f206..de71cae89d 100644 Binary files a/dev/chunkedcommit/.doctrees/information/environment.result.doctree and b/dev/chunkedcommit/.doctrees/information/environment.result.doctree differ diff --git a/dev/chunkedcommit/.doctrees/nbsphinx/information/environment.ipynb b/dev/chunkedcommit/.doctrees/nbsphinx/information/environment.ipynb index b355896d5c..7cd8f8e462 100644 --- a/dev/chunkedcommit/.doctrees/nbsphinx/information/environment.ipynb +++ b/dev/chunkedcommit/.doctrees/nbsphinx/information/environment.ipynb @@ -29,10 +29,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-07-21T06:41:20.650363Z", - "iopub.status.busy": "2024-07-21T06:41:20.650167Z", - "iopub.status.idle": "2024-07-21T06:41:21.811771Z", - "shell.execute_reply": "2024-07-21T06:41:21.811134Z" + "iopub.execute_input": "2024-07-21T07:01:17.464096Z", + "iopub.status.busy": "2024-07-21T07:01:17.463535Z", + "iopub.status.idle": "2024-07-21T07:01:18.629735Z", + "shell.execute_reply": "2024-07-21T07:01:18.628955Z" }, "pycharm": { "name": "#%%\n" @@ -53,7 +53,7 @@ "text": [ "CPU Brand: AMD EPYC 7763 64-Core Processor\n", "CPU Count: 4\n", - "CPU Freq: 3086.9095 MHz\n", + "CPU Freq: 2938.7805 MHz\n", "Memory Size: 15.606 GiB\n", "Has CUDA: No\n" ] diff --git a/dev/chunkedcommit/.doctrees/nbsphinx/information/environment.result.ipynb b/dev/chunkedcommit/.doctrees/nbsphinx/information/environment.result.ipynb index 074c31d909..ab58fd2e77 100644 --- a/dev/chunkedcommit/.doctrees/nbsphinx/information/environment.result.ipynb +++ b/dev/chunkedcommit/.doctrees/nbsphinx/information/environment.result.ipynb @@ -29,10 +29,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-07-21T06:12:48.438134Z", - "iopub.status.busy": "2024-07-21T06:12:48.437738Z", - "iopub.status.idle": "2024-07-21T06:12:49.608988Z", - "shell.execute_reply": "2024-07-21T06:12:49.608237Z" + "iopub.execute_input": "2024-07-21T06:31:39.044488Z", + "iopub.status.busy": "2024-07-21T06:31:39.043994Z", + "iopub.status.idle": "2024-07-21T06:31:40.217926Z", + "shell.execute_reply": "2024-07-21T06:31:40.217154Z" }, "pycharm": { "name": "#%%\n" @@ -53,7 +53,7 @@ "text": [ "CPU Brand: AMD EPYC 7763 64-Core Processor\n", "CPU Count: 4\n", - "CPU Freq: 2936.629 MHz\n", + "CPU Freq: 2921.47025 MHz\n", "Memory Size: 15.606 GiB\n", "Has CUDA: No\n" ] diff --git a/dev/chunkedcommit/.doctrees/tutorials/installation/index.doctree b/dev/chunkedcommit/.doctrees/tutorials/installation/index.doctree index 7fb0cbe16f..07f2094c11 100644 Binary files a/dev/chunkedcommit/.doctrees/tutorials/installation/index.doctree and b/dev/chunkedcommit/.doctrees/tutorials/installation/index.doctree differ diff --git a/dev/chunkedcommit/.doctrees/tutorials/quick_start/index.doctree b/dev/chunkedcommit/.doctrees/tutorials/quick_start/index.doctree index b58c675d51..ef3c8f3556 100644 Binary files a/dev/chunkedcommit/.doctrees/tutorials/quick_start/index.doctree and b/dev/chunkedcommit/.doctrees/tutorials/quick_start/index.doctree differ diff --git a/dev/chunkedcommit/_modules/hfutils/operate/upload.html b/dev/chunkedcommit/_modules/hfutils/operate/upload.html index 172a852e38..0a35d06faa 100644 --- a/dev/chunkedcommit/_modules/hfutils/operate/upload.html +++ b/dev/chunkedcommit/_modules/hfutils/operate/upload.html @@ -100,13 +100,15 @@

Source code for hfutils.operate.upload

 import math
 import os.path
 import re
+import time
 from typing import Optional, List
 
+from hbutils.string import plural_word
 from huggingface_hub import CommitOperationAdd, CommitOperationDelete
 
 from .base import RepoTypeTyping, get_hf_client, list_files_in_repository, _IGNORE_PATTERN_UNSET
 from ..archive import get_archive_type, archive_pack
-from ..utils import walk_files, TemporaryDirectory
+from ..utils import walk_files, TemporaryDirectory, tqdm
 
 
 
[docs]def upload_file_to_file(local_file, repo_id: str, file_in_repo: str, @@ -176,11 +178,14 @@

Source code for hfutils.operate.upload

 _PATH_SEP = re.compile(r'[/\\]+')
 
 
-
[docs]def upload_directory_as_directory(local_directory, repo_id: str, path_in_repo: str, - repo_type: RepoTypeTyping = 'dataset', revision: str = 'main', - message: Optional[str] = None, time_suffix: bool = True, - clear: bool = False, ignore_patterns: List[str] = _IGNORE_PATTERN_UNSET, - hf_token: Optional[str] = None, operation_chunk_size: Optional[int] = None): +
[docs]def upload_directory_as_directory( + local_directory, repo_id: str, path_in_repo: str, + repo_type: RepoTypeTyping = 'dataset', revision: str = 'main', + message: Optional[str] = None, time_suffix: bool = True, + clear: bool = False, ignore_patterns: List[str] = _IGNORE_PATTERN_UNSET, + hf_token: Optional[str] = None, operation_chunk_size: Optional[int] = None, + upload_timespan: float = 5.0, +): """ Upload a local directory and its files to a specified path in a Hugging Face repository. @@ -207,6 +212,8 @@

Source code for hfutils.operate.upload

     :param operation_chunk_size: Chunk size of the operations. All the operations will be
         seperated into multiple commits when this is set.
     :type operation_chunk_size: Optional[int]
+    :param upload_timespan: Upload minimal time interval when chunked uploading enabled.
+    :type upload_timespan: float
 
     .. note::
         When `operation_chunk_size` is set, multiple commits will be created. When some commits failed,
@@ -215,6 +222,11 @@ 

Source code for hfutils.operate.upload

     .. warning::
         When `operation_chunk_size` is set, multiple commits will be created. But HuggingFace's repository
         api cannot guarantee the atomic feature of your data. So **this function is not thread-safe**.
+
+    .. note::
+        The rate limit of HuggingFace repository commit creation is approximately 120 commits / hour.
+        So if you really have large number of chunks to create, please set the `upload_timespan` to a value
+        no less than `30.0` to make sure your uploading will not be rate-limited.
     """
     hf_client = get_hf_client(hf_token)
     if clear:
@@ -252,9 +264,21 @@ 

Source code for hfutils.operate.upload

             revision=revision
         )[0].commit_id
 
+        last_upload_at = None
         try:
-            for chunk_id in range(int(math.ceil(len(operations) / operation_chunk_size))):
+            for chunk_id in tqdm(range(int(math.ceil(len(operations) / operation_chunk_size))),
+                                 desc='Chunked Commits'):
                 operation_chunk = operations[chunk_id * operation_chunk_size:(chunk_id + 1) * operation_chunk_size]
+
+                # sleep for the given time
+                if last_upload_at:
+                    sleep_time = last_upload_at + upload_timespan - time.time()
+                    if sleep_time > 0:
+                        logging.info(f'Sleep for {sleep_time:.1f}s due to the timespan limitation ...')
+                        time.sleep(sleep_time)
+
+                last_upload_at = time.time()
+                logging.info(f'Uploading chunk #{chunk_id}, with {plural_word(len(operation_chunk), "operation")} ...')
                 hf_client.create_commit(
                     repo_id=repo_id,
                     repo_type=repo_type,
@@ -262,6 +286,8 @@ 

Source code for hfutils.operate.upload

                     operations=operation_chunk,
                     commit_message=f'[Chunk #{chunk_id}] {commit_message}',
                 )
+
+
         except Exception:
             from ..repository import hf_hub_rollback
 
diff --git a/dev/chunkedcommit/_sources/information/environment.result.ipynb.txt b/dev/chunkedcommit/_sources/information/environment.result.ipynb.txt
index 074c31d909..ab58fd2e77 100644
--- a/dev/chunkedcommit/_sources/information/environment.result.ipynb.txt
+++ b/dev/chunkedcommit/_sources/information/environment.result.ipynb.txt
@@ -29,10 +29,10 @@
    "execution_count": 1,
    "metadata": {
     "execution": {
-     "iopub.execute_input": "2024-07-21T06:12:48.438134Z",
-     "iopub.status.busy": "2024-07-21T06:12:48.437738Z",
-     "iopub.status.idle": "2024-07-21T06:12:49.608988Z",
-     "shell.execute_reply": "2024-07-21T06:12:49.608237Z"
+     "iopub.execute_input": "2024-07-21T06:31:39.044488Z",
+     "iopub.status.busy": "2024-07-21T06:31:39.043994Z",
+     "iopub.status.idle": "2024-07-21T06:31:40.217926Z",
+     "shell.execute_reply": "2024-07-21T06:31:40.217154Z"
     },
     "pycharm": {
      "name": "#%%\n"
@@ -53,7 +53,7 @@
      "text": [
       "CPU Brand: AMD EPYC 7763 64-Core Processor\n",
       "CPU Count: 4\n",
-      "CPU Freq: 2936.629 MHz\n",
+      "CPU Freq: 2921.47025 MHz\n",
       "Memory Size: 15.606 GiB\n",
       "Has CUDA: No\n"
      ]
diff --git a/dev/chunkedcommit/api_doc/operate/upload.html b/dev/chunkedcommit/api_doc/operate/upload.html
index 3a857c8ced..38a4d916bc 100644
--- a/dev/chunkedcommit/api_doc/operate/upload.html
+++ b/dev/chunkedcommit/api_doc/operate/upload.html
@@ -169,7 +169,7 @@ 

upload_directory_as_archive

-hfutils.operate.upload.upload_directory_as_directory(local_directory, repo_id: str, path_in_repo: str, repo_type: ~typing.Literal['dataset', 'model', 'space'] = 'dataset', revision: str = 'main', message: str | None = None, time_suffix: bool = True, clear: bool = False, ignore_patterns: ~typing.List[str] = <object object>, hf_token: str | None = None, operation_chunk_size: int | None = None)[source]
+hfutils.operate.upload.upload_directory_as_directory(local_directory, repo_id: str, path_in_repo: str, repo_type: ~typing.Literal['dataset', 'model', 'space'] = 'dataset', revision: str = 'main', message: str | None = None, time_suffix: bool = True, clear: bool = False, ignore_patterns: ~typing.List[str] = <object object>, hf_token: str | None = None, operation_chunk_size: int | None = None, upload_timespan: float = 5.0)[source]

Upload a local directory and its files to a specified path in a Hugging Face repository.

Parameters:
@@ -186,6 +186,7 @@

upload_directory_as_directoryHF_TOKEN variable if not assigned.

  • operation_chunk_size (Optional[int]) – Chunk size of the operations. All the operations will be seperated into multiple commits when this is set.

  • +
  • upload_timespan (float) – Upload minimal time interval when chunked uploading enabled.

  • @@ -199,6 +200,12 @@

    upload_directory_as_directory +

    Note

    +

    The rate limit of HuggingFace repository commit creation is approximately 120 commits / hour. +So if you really have large number of chunks to create, please set the upload_timespan to a value +no less than 30.0 to make sure your uploading will not be rate-limited.

    +

    diff --git a/dev/chunkedcommit/information/environment.html b/dev/chunkedcommit/information/environment.html index 7062987c1a..2f039c1a08 100644 --- a/dev/chunkedcommit/information/environment.html +++ b/dev/chunkedcommit/information/environment.html @@ -132,7 +132,7 @@

    Run Environment InformationRun Environment InformationRun Environment InformationRun Environment InformationRun Environment InformationRun Environment InformationRun Environment InformationRun Environment InformationRun Environment InformationRun Environment InformationRun Environment InformationRun Environment InformationRun Environment InformationRun Environment InformationRun Environment InformationRun Environment InformationRun Environment InformationRun Environment InformationRun Environment InformationRun Environment InformationRun Environment InformationRun Environment InformationRun Environment InformationRun Environment InformationRun Environment InformationRun Environment InformationRun Environment InformationRun Environment InformationRun Environment InformationRun Environment InformationRun Environment InformationRun Environment InformationRun Environment InformationRun Environment InformationRun Environment InformationRun Environment InformationRun Environment InformationRun Environment InformationRun Environment InformationRun Environment InformationRun Environment InformationRun Environment InformationRun Environment InformationRun Environment InformationRun Environment InformationRun Environment InformationRun Environment InformationRun Environment Information