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.

Files changed (61) hide show
  1. huggingface_hub/__init__.py +49 -23
  2. huggingface_hub/_commit_scheduler.py +30 -4
  3. huggingface_hub/_local_folder.py +0 -4
  4. huggingface_hub/_login.py +38 -54
  5. huggingface_hub/_snapshot_download.py +6 -3
  6. huggingface_hub/_tensorboard_logger.py +2 -3
  7. huggingface_hub/_upload_large_folder.py +1 -1
  8. huggingface_hub/errors.py +19 -0
  9. huggingface_hub/fastai_utils.py +3 -2
  10. huggingface_hub/file_download.py +10 -12
  11. huggingface_hub/hf_api.py +102 -498
  12. huggingface_hub/hf_file_system.py +274 -35
  13. huggingface_hub/hub_mixin.py +5 -25
  14. huggingface_hub/inference/_client.py +185 -136
  15. huggingface_hub/inference/_common.py +2 -2
  16. huggingface_hub/inference/_generated/_async_client.py +186 -137
  17. huggingface_hub/inference/_generated/types/__init__.py +31 -10
  18. huggingface_hub/inference/_generated/types/audio_classification.py +3 -5
  19. huggingface_hub/inference/_generated/types/automatic_speech_recognition.py +6 -9
  20. huggingface_hub/inference/_generated/types/chat_completion.py +8 -5
  21. huggingface_hub/inference/_generated/types/depth_estimation.py +1 -1
  22. huggingface_hub/inference/_generated/types/document_question_answering.py +2 -6
  23. huggingface_hub/inference/_generated/types/feature_extraction.py +1 -1
  24. huggingface_hub/inference/_generated/types/fill_mask.py +2 -4
  25. huggingface_hub/inference/_generated/types/image_classification.py +3 -5
  26. huggingface_hub/inference/_generated/types/image_segmentation.py +2 -4
  27. huggingface_hub/inference/_generated/types/image_to_image.py +2 -4
  28. huggingface_hub/inference/_generated/types/image_to_text.py +6 -9
  29. huggingface_hub/inference/_generated/types/object_detection.py +2 -4
  30. huggingface_hub/inference/_generated/types/question_answering.py +2 -4
  31. huggingface_hub/inference/_generated/types/sentence_similarity.py +1 -1
  32. huggingface_hub/inference/_generated/types/summarization.py +2 -4
  33. huggingface_hub/inference/_generated/types/table_question_answering.py +21 -3
  34. huggingface_hub/inference/_generated/types/text2text_generation.py +2 -4
  35. huggingface_hub/inference/_generated/types/text_classification.py +4 -10
  36. huggingface_hub/inference/_generated/types/text_to_audio.py +7 -10
  37. huggingface_hub/inference/_generated/types/text_to_image.py +2 -4
  38. huggingface_hub/inference/_generated/types/text_to_speech.py +7 -10
  39. huggingface_hub/inference/_generated/types/token_classification.py +11 -12
  40. huggingface_hub/inference/_generated/types/translation.py +2 -4
  41. huggingface_hub/inference/_generated/types/video_classification.py +3 -4
  42. huggingface_hub/inference/_generated/types/visual_question_answering.py +2 -5
  43. huggingface_hub/inference/_generated/types/zero_shot_classification.py +8 -18
  44. huggingface_hub/inference/_generated/types/zero_shot_image_classification.py +9 -19
  45. huggingface_hub/inference/_generated/types/zero_shot_object_detection.py +7 -9
  46. huggingface_hub/keras_mixin.py +3 -2
  47. huggingface_hub/lfs.py +2 -5
  48. huggingface_hub/repocard_data.py +4 -4
  49. huggingface_hub/serialization/__init__.py +2 -0
  50. huggingface_hub/serialization/_dduf.py +387 -0
  51. huggingface_hub/serialization/_torch.py +407 -25
  52. huggingface_hub/utils/_cache_manager.py +1 -1
  53. huggingface_hub/utils/_headers.py +9 -25
  54. huggingface_hub/utils/tqdm.py +15 -0
  55. {huggingface_hub-0.26.3.dist-info → huggingface_hub-0.27.0rc1.dist-info}/METADATA +8 -3
  56. {huggingface_hub-0.26.3.dist-info → huggingface_hub-0.27.0rc1.dist-info}/RECORD +60 -60
  57. huggingface_hub/_multi_commits.py +0 -306
  58. {huggingface_hub-0.26.3.dist-info → huggingface_hub-0.27.0rc1.dist-info}/LICENSE +0 -0
  59. {huggingface_hub-0.26.3.dist-info → huggingface_hub-0.27.0rc1.dist-info}/WHEEL +0 -0
  60. {huggingface_hub-0.26.3.dist-info → huggingface_hub-0.27.0rc1.dist-info}/entry_points.txt +0 -0
  61. {huggingface_hub-0.26.3.dist-info → huggingface_hub-0.27.0rc1.dist-info}/top_level.txt +0 -0
@@ -81,6 +81,8 @@ Group-based control:
81
81
  """
82
82
 
83
83
  import io
84
+ import logging
85
+ import os
84
86
  import warnings
85
87
  from contextlib import contextmanager
86
88
  from pathlib import Path
@@ -196,6 +198,19 @@ def are_progress_bars_disabled(name: Optional[str] = None) -> bool:
196
198
  return not progress_bar_states.get("_global", True)
197
199
 
198
200
 
201
+ def is_tqdm_disabled(log_level: int) -> Optional[bool]:
202
+ """
203
+ Determine if tqdm progress bars should be disabled based on logging level and environment settings.
204
+
205
+ see https://github.com/huggingface/huggingface_hub/pull/2000 and https://github.com/huggingface/huggingface_hub/pull/2698.
206
+ """
207
+ if log_level == logging.NOTSET:
208
+ return True
209
+ if os.getenv("TQDM_POSITION") == "-1":
210
+ return False
211
+ return None
212
+
213
+
199
214
  class tqdm(old_tqdm):
200
215
  """
201
216
  Class to override `disable` argument in case progress bars are globally disabled.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: huggingface-hub
3
- Version: 0.26.3
3
+ Version: 0.27.0rc1
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.
@@ -20,6 +20,7 @@ Classifier: Programming Language :: Python :: 3.9
20
20
  Classifier: Programming Language :: Python :: 3.10
21
21
  Classifier: Programming Language :: Python :: 3.11
22
22
  Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Programming Language :: Python :: 3.13
23
24
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
24
25
  Requires-Python: >=3.8.0
25
26
  Description-Content-Type: text/markdown
@@ -142,10 +143,14 @@ Requires-Dist: types-tqdm; extra == "typing"
142
143
  Requires-Dist: types-urllib3; extra == "typing"
143
144
 
144
145
  <p align="center">
146
+ <picture>
147
+ <source media="(prefers-color-scheme: dark)" srcset="https://huggingface.co/datasets/huggingface/documentation-images/raw/main/huggingface_hub-dark.svg">
148
+ <source media="(prefers-color-scheme: light)" srcset="https://huggingface.co/datasets/huggingface/documentation-images/raw/main/huggingface_hub.svg">
149
+ <img alt="huggingface_hub library logo" src="https://huggingface.co/datasets/huggingface/documentation-images/raw/main/huggingface_hub.svg" width="352" height="59" style="max-width: 100%;">
150
+ </picture>
145
151
  <br/>
146
- <img alt="huggingface_hub library logo" src="https://huggingface.co/datasets/huggingface/documentation-images/raw/main/huggingface_hub.svg" width="376" height="59" style="max-width: 100%;">
147
152
  <br/>
148
- </p>
153
+ </p>
149
154
 
150
155
  <p align="center">
151
156
  <i>The official Python client for the Huggingface Hub.</i>
@@ -1,29 +1,28 @@
1
- huggingface_hub/__init__.py,sha256=TvADZbi2Jw5oeg_Mu-yZ7xo66rN_x7RTs1F6c9gt2aI,35993
1
+ huggingface_hub/__init__.py,sha256=C0iat0Hr6d_yWrUAL-9rHMufi54U_ASl_wEGXQIBuDg,37217
2
2
  huggingface_hub/_commit_api.py,sha256=Y9eTaW4bYzxtrZsSniVtfeAuFafqx8x1ofMI5es8hvM,31057
3
- huggingface_hub/_commit_scheduler.py,sha256=nlJS_vnLb8i92NLrRwJX8Mg9QZ7f3kfLbLlQuEd5YjU,13647
3
+ huggingface_hub/_commit_scheduler.py,sha256=tfIoO1xWHjTJ6qy6VS6HIoymDycFPg0d6pBSZprrU2U,14679
4
4
  huggingface_hub/_inference_endpoints.py,sha256=wzjD8P68VpUDHzIDbXzFXsM2Y-aNVSAap7BXsZFuthk,16750
5
- huggingface_hub/_local_folder.py,sha256=PBycy5l4iyugz0NCExSfbSon1IwqPiblC6Xy4eeFYCU,16392
6
- huggingface_hub/_login.py,sha256=dlku1N_v4HPtsaJHdlssf3uYcy4uNOLK-aZuzAvxPfo,20878
7
- huggingface_hub/_multi_commits.py,sha256=mFmCP_5hNsruEgDF6kOVyaFkpnbSdNxPWfGUlFbl5O8,12535
8
- huggingface_hub/_snapshot_download.py,sha256=Vnvz0liOFTEARscOuOpA3WUTjnX5ufi6N5D5KIj9fwU,14847
5
+ huggingface_hub/_local_folder.py,sha256=p9KQJkGD4ZrQ-2gbprB_NsOWGZJ_T5mYGh_BB8gqvx8,16259
6
+ huggingface_hub/_login.py,sha256=ssf4viT5BhHI2ZidnSuAZcrwSxzaLOrf8xgRVKuvu_A,20298
7
+ huggingface_hub/_snapshot_download.py,sha256=zZDaPBb4CfMCU7DgxjbaFmdoISCY425RaH7wXwFijEM,14992
9
8
  huggingface_hub/_space_api.py,sha256=QVOUNty2T4RxPoxf9FzUjXmjHiGXP0mqXJzqQ7GmoJo,5363
10
- huggingface_hub/_tensorboard_logger.py,sha256=F-2l3BsHVEar8PSFhPOwprMsvkwprPgpkOTWqeMMobM,8299
11
- huggingface_hub/_upload_large_folder.py,sha256=hrm29zJXnWpxBgfJ-pmqaDwWl5WNYiYuQkKaGwXu-BA,23475
9
+ huggingface_hub/_tensorboard_logger.py,sha256=ZkYcAUiRC8RGL214QUYtp58O8G5tn-HF6DCWha9imcA,8358
10
+ huggingface_hub/_upload_large_folder.py,sha256=g9P2-pQkbOd9UF_unXd9SpCX8p_U0gLyjqXZpkUl4p0,23484
12
11
  huggingface_hub/_webhooks_payload.py,sha256=Xm3KaK7tCOGBlXkuZvbym6zjHXrT1XCrbUFWuXiBmNY,3617
13
12
  huggingface_hub/_webhooks_server.py,sha256=oCvpFrYjrhJjClAMw26SQfvN4DUItgK2IhFp1OVh2bU,15623
14
13
  huggingface_hub/community.py,sha256=4MtcoxEI9_0lmmilBEnvUEi8_O1Ivfa8p6eKxYU5-ts,12198
15
14
  huggingface_hub/constants.py,sha256=WshhUKAs6kyoBPN1ek9Zsr2JY-bvjof69VJOfuu8tm4,8090
16
- huggingface_hub/errors.py,sha256=CbcLWbwQG5P1kReMUmCovPONciXmqLfTzAHXD-xJVDs,9276
17
- huggingface_hub/fastai_utils.py,sha256=o0BnmigoNP3H7Sf8w8bwuRaN-9FKlL6uoPawr4HSyjc,16647
18
- huggingface_hub/file_download.py,sha256=Y4ngJd_V37OCjJichBE0ZuHiP-Z_B4jaxgeeEGGJzXg,70630
19
- huggingface_hub/hf_api.py,sha256=p1lwufce0XsOjZ_OmXSSA0erHCAliyPMQi7pCYhDlvE,440149
20
- huggingface_hub/hf_file_system.py,sha256=2i88wje7OcYZPgMv_TRXHZso1D26wmY6Sj3ZL5BqICo,39163
21
- huggingface_hub/hub_mixin.py,sha256=H6gN5EBRn5A8zc6jHj1FpjGDLOar2M67wOssGkvin0M,37551
15
+ huggingface_hub/errors.py,sha256=zble0j94ai8zwyM0a2DovwcF372zQohwDsgajTsaxqI,9703
16
+ huggingface_hub/fastai_utils.py,sha256=DpeH9d-6ut2k_nCAAwglM51XmRmgfbRe2SPifpVL5Yk,16745
17
+ huggingface_hub/file_download.py,sha256=NaHWoBHK4seUdhnx2zbtaTBK0TvTMsFqh2_gPKVTc2g,70380
18
+ huggingface_hub/hf_api.py,sha256=ORNYYlvHLiLRLcw2snHp6iIjv_jk15IPRL_ikw4Cc8M,422655
19
+ huggingface_hub/hf_file_system.py,sha256=m_g7uYLGxTdsBnhvR5835jvYMAuEBsUSFvEbzZKzzoo,47500
20
+ huggingface_hub/hub_mixin.py,sha256=_NOs2f7fQUAPIWltYDGGW81tkrguuHymMdIkw8Ct3Pw,37223
22
21
  huggingface_hub/inference_api.py,sha256=b4-NhPSn9b44nYKV8tDKXodmE4JVdEymMWL4CVGkzlE,8323
23
- huggingface_hub/keras_mixin.py,sha256=LReKRHE4y9kN-r7WdqtUYJY2mYKkhN1nJ8Jl6v52P7A,19483
24
- huggingface_hub/lfs.py,sha256=xQE8HTZmzILey8aqURpD-NO6_z1LUasOJssXiBcm0s4,16827
22
+ huggingface_hub/keras_mixin.py,sha256=3d2oW35SALXHq-WHoLD_tbq0UrcabGKj3HidtPRx51U,19574
23
+ huggingface_hub/lfs.py,sha256=n-TIjK7J7aXG3zi__0nkd6aNkE4djOf9CD6dYQOQ5P8,16649
25
24
  huggingface_hub/repocard.py,sha256=86FiLCufy9oLf6moGkfmi9h3euGwDDY4eLrs0GKWBRk,34732
26
- huggingface_hub/repocard_data.py,sha256=lGC_QpmCZR4nMTO8E5-EpdOAARSe1_5uGRszPBuIg7s,33123
25
+ huggingface_hub/repocard_data.py,sha256=rgpr3xbwMNvmoazkz0AgRaWINPdyy5kd70eVn0j4AzQ,33204
27
26
  huggingface_hub/repository.py,sha256=xVQR-MRKNDfJ_Z_99DwtXZB3xNO06eYG_GvRM4fLiTU,54557
28
27
  huggingface_hub/commands/__init__.py,sha256=AkbM2a-iGh0Vq_xAWhK3mu3uZ44km8-X5uWjKcvcrUQ,928
29
28
  huggingface_hub/commands/_cli_utils.py,sha256=Nt6CjbkYqQQRuh70bUXVA6rZpbZt_Sa1WqBUxjQLu6g,2095
@@ -40,59 +39,60 @@ huggingface_hub/commands/upload_large_folder.py,sha256=LKvzEmKeRatBLlnJF__b5jFBQ
40
39
  huggingface_hub/commands/user.py,sha256=M6Ef045YcyV4mFCbLaTRPciQDC6xtV9MMheeen69D0E,11168
41
40
  huggingface_hub/commands/version.py,sha256=vfCJn7GO1m-DtDmbdsty8_RTVtnZ7lX6MJsx0Bf4e-s,1266
42
41
  huggingface_hub/inference/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
43
- huggingface_hub/inference/_client.py,sha256=W34WHKnZq5FpY7zxTE9UNZtQZVmrjYCApZEozK-kIkA,146734
44
- huggingface_hub/inference/_common.py,sha256=_SgAkuM4a2FgONO8hoaOPDLsYFPzy9eZNkeYtq7hTJ4,16822
42
+ huggingface_hub/inference/_client.py,sha256=DXQiejjYkZnRtefIaCjkEZxzlcyjMhwAaE3xAn_dcTw,149096
43
+ huggingface_hub/inference/_common.py,sha256=sIgFTKBcoIwddzwGsQa0a0eAQ8SgXP6eenD5lzBub8E,16819
45
44
  huggingface_hub/inference/_generated/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
46
- huggingface_hub/inference/_generated/_async_client.py,sha256=twguBoU27X-yH-uAJKRSQ3Q8nDxzeudUSZQBcOMPG6U,153274
47
- huggingface_hub/inference/_generated/types/__init__.py,sha256=fJK7_Df3ftSTkZYaJngZUcV5YtVLPm9-Zd5WXrGr9m0,5768
48
- huggingface_hub/inference/_generated/types/audio_classification.py,sha256=krHh0MaHokL6wFxjdRVB-1Tdstl_RCyi_AfRJTTxr6Y,1529
45
+ huggingface_hub/inference/_generated/_async_client.py,sha256=sV3fcN2HQUquwU8N9Ag9yyzJGFeAFHBC8mU-ttN-Vk8,155645
46
+ huggingface_hub/inference/_generated/types/__init__.py,sha256=IOp7v252gLZbFb7MUCjDSvzwchycZqUo2gZPrpSDtV8,6211
47
+ huggingface_hub/inference/_generated/types/audio_classification.py,sha256=U340ccLtMjqRMtD3hviXCQaWk_DWJgQWor8vLgW_GKM,1552
49
48
  huggingface_hub/inference/_generated/types/audio_to_audio.py,sha256=n7GeCepzt254yoSLsdjrI1j4fzYgjWzxoaKE5gZJc48,881
50
- huggingface_hub/inference/_generated/types/automatic_speech_recognition.py,sha256=NHkz-IivdK8gHDuPalZ3Q9ubxESltjCnwrR1Z52KejY,5531
49
+ huggingface_hub/inference/_generated/types/automatic_speech_recognition.py,sha256=g5L2LasOLPW49ik69SlUu-EVdNn7IWWpmGhaP9b-en0,5582
51
50
  huggingface_hub/inference/_generated/types/base.py,sha256=dQ-ej4weVueTJQXaDFLYFhKvlCUYVH2k9r-Ck0uhFIU,5870
52
- huggingface_hub/inference/_generated/types/chat_completion.py,sha256=FpY0K5ENGTdBSNLeioKwdOuegg1jvyEQYmsrrQVhD7Y,9462
53
- huggingface_hub/inference/_generated/types/depth_estimation.py,sha256=lmLmd8S313ZMCG94RblwquL0UN_0hJmXAhWUqSIrtwc,898
54
- huggingface_hub/inference/_generated/types/document_question_answering.py,sha256=_hBzK4Pu9X_zXsgOO4JNSloIKuVfE5m7eGwEw5YTfZ4,3264
55
- huggingface_hub/inference/_generated/types/feature_extraction.py,sha256=FYjXh60gaRKCwwrb9DFEshAY_7axO88RifzHfig7RNI,1490
56
- huggingface_hub/inference/_generated/types/fill_mask.py,sha256=JcYIbTDXc4f7k2FNY3fCWtJ9ke3HUZFz2pDOOrDuxOs,1714
57
- huggingface_hub/inference/_generated/types/image_classification.py,sha256=GvJaHykIYmGF8oGabbLvz1Ski_AclnoCu-y8mVZKXs0,1541
58
- huggingface_hub/inference/_generated/types/image_segmentation.py,sha256=fLvhgo_1eTeZFk8DuGXOY27ZagjIMJ_07HtkLXXRmO4,1947
59
- huggingface_hub/inference/_generated/types/image_to_image.py,sha256=sNAJvUT9xJwLqFm0UngzDB6wEdqsJCGb7zhZDAtwPe0,1967
60
- huggingface_hub/inference/_generated/types/image_to_text.py,sha256=QSU2VD1ibviqKrcjILlqzTk-YrxYF49qr3MSdqRD12U,4851
61
- huggingface_hub/inference/_generated/types/object_detection.py,sha256=cyXvMsmHeA9LI2xKJEQCnSgFJMGC1gdEtc5QjnSiSII,1988
62
- huggingface_hub/inference/_generated/types/question_answering.py,sha256=xLDy5oA-k9JPncSU6NqPAPb8rWPerfTbU857G3e7JZ0,2884
63
- huggingface_hub/inference/_generated/types/sentence_similarity.py,sha256=edH-TWfnZ4J0zJD-zqfcRMLwOV0dTt1g5Y0caYnVuPc,1018
64
- huggingface_hub/inference/_generated/types/summarization.py,sha256=0LPPg0KxX4aIh4FVA3NxWy0OxPe8yTdPpe2tbfH2c9g,1490
65
- huggingface_hub/inference/_generated/types/table_question_answering.py,sha256=PuVZlR6dI6FEUK7pjMSVMtzkDgrcxdKjfcnDbVmPdSs,1569
66
- huggingface_hub/inference/_generated/types/text2text_generation.py,sha256=SZYfdhyraG5vZ2Jzm1C8k9w9IYLxMtm5UUu1tU2oOQk,1604
67
- huggingface_hub/inference/_generated/types/text_classification.py,sha256=p7bvpM7ULZPnzPZutNYS7-3J6mtL8rToEnCVOGp-TzI,1392
51
+ huggingface_hub/inference/_generated/types/chat_completion.py,sha256=6QKg0upzaNTv5esWfRZbtYixNrcsvGNrUpPw1mNezQ8,9589
52
+ huggingface_hub/inference/_generated/types/depth_estimation.py,sha256=3ZUI2w3J-WgDDxlRQ_444r46TlFRhHBt2LN2LLVJB-w,919
53
+ huggingface_hub/inference/_generated/types/document_question_answering.py,sha256=NtEF_MRPbj4iaNIFSBC5sPf92HKeOc3B7ZZE1RooLFU,3170
54
+ huggingface_hub/inference/_generated/types/feature_extraction.py,sha256=-lCiN_i4ChGz4Dtw75muArKuvVfpquy-XRfC7OS7r0Q,1490
55
+ huggingface_hub/inference/_generated/types/fill_mask.py,sha256=fxYjJgERCwKS-LUc3FPfKEqo0x-BemwmC_MbgUZwdkQ,1687
56
+ huggingface_hub/inference/_generated/types/image_classification.py,sha256=hCvz1MpMVXY3KlVENmq1Ygn4SsbE9UngPH9Y7Nj_kgg,1564
57
+ huggingface_hub/inference/_generated/types/image_segmentation.py,sha256=4T0rj-wGJnmqvbcj7kVt_L_mhWjEpjFH9o0VhHXaGRs,1929
58
+ huggingface_hub/inference/_generated/types/image_to_image.py,sha256=ZJnOADT1UE0kuBJxiA4ITTjQmp0PI4p3DcNoWRzSwkE,1945
59
+ huggingface_hub/inference/_generated/types/image_to_text.py,sha256=kocfj5jn_sPDk5FSR_PGl4Xq72BNHOwHEKCP3wv2poY,4887
60
+ huggingface_hub/inference/_generated/types/object_detection.py,sha256=eS3bbkpdtjLu2k2TjlEvLjVtMI5OdHJK1jq3kTzVZdQ,1968
61
+ huggingface_hub/inference/_generated/types/question_answering.py,sha256=Dzpwz3KWq3uQuzIwMRbUxSHscpLsVOPjwrKVqLJR5vA,2866
62
+ huggingface_hub/inference/_generated/types/sentence_similarity.py,sha256=y3KHkCYxn1tOEPrOQ6DNqQtCEhNNtGEN5aMstiQ6hVA,1042
63
+ huggingface_hub/inference/_generated/types/summarization.py,sha256=uwW7QdEXhWSkDIqlz_EEZiaaQscgjzTocR1bu7LRaxU,1466
64
+ huggingface_hub/inference/_generated/types/table_question_answering.py,sha256=YLMT7FY_nx6CSv146p6MyFMzwSZLsYSmOQVG39aiKUQ,2261
65
+ huggingface_hub/inference/_generated/types/text2text_generation.py,sha256=dqwTt-i-k6jo9DdGUS5ZRtrkLTVWoje3L5C3-pMv45Q,1588
66
+ huggingface_hub/inference/_generated/types/text_classification.py,sha256=j-0g3Ajaxg4e5TQlNs3UqVryvp5delYm8znrgzvkW-8,1424
68
67
  huggingface_hub/inference/_generated/types/text_generation.py,sha256=TKJb26T03Gyw3As0IXmRzAritNeKUpturKfO_2OenzA,5798
69
- huggingface_hub/inference/_generated/types/text_to_audio.py,sha256=9aGy51OiyvOu5G6pOmq6OLuEpUVj0c_b1wEguuSjY40,4841
70
- huggingface_hub/inference/_generated/types/text_to_image.py,sha256=R-ecvxC7IrFB5wo9BBSLh_zvFAYpmMJdLF8KmtD3sBI,2007
71
- huggingface_hub/inference/_generated/types/text_to_speech.py,sha256=_70NMzETkDoEkpV6t2Ts95cISeyHjIDKALfrZRd0cfg,4898
72
- huggingface_hub/inference/_generated/types/token_classification.py,sha256=7oL8AZOTWtf2bYD2T3236GDNMtUl7FtydaB6We7wbfw,1890
73
- huggingface_hub/inference/_generated/types/translation.py,sha256=lpyfGtFKCyWFD5wi7v8wPGn_vrJF4L8O9g7UigTDlJk,1767
74
- huggingface_hub/inference/_generated/types/video_classification.py,sha256=uK1wYrAcnXSiLgL64idGWC2t-512N-zWtAcDcYaola0,1589
75
- huggingface_hub/inference/_generated/types/visual_question_answering.py,sha256=0PHNnjwxxHvG3SjOz7O7DckbBeGYDsRmlagG11qIkkM,1667
76
- huggingface_hub/inference/_generated/types/zero_shot_classification.py,sha256=u6jfFCqDv9XqeAN5E9_Xf7jqMZgqTRFF_S9PtWbiBUk,1963
77
- huggingface_hub/inference/_generated/types/zero_shot_image_classification.py,sha256=qVH6Ms0FjF8TraGy4BYiS8lmvGq9xiIDdXqGFynLHMA,1689
78
- huggingface_hub/inference/_generated/types/zero_shot_object_detection.py,sha256=PU4OOlQ2aAOosW2JlG2Z27MEQpmE6BxcygH_ns3w1KQ,1662
79
- huggingface_hub/serialization/__init__.py,sha256=z5MLxMqz0Y2qST-3Lj0PZHUONL-SGRlc0g4Z6MdL6rw,988
68
+ huggingface_hub/inference/_generated/types/text_to_audio.py,sha256=y5pT8-hWr1CK1Zxi0LPcfNbk2Mr0_DdfpRKRP1jSNts,4879
69
+ huggingface_hub/inference/_generated/types/text_to_image.py,sha256=DsCku9u8MaXdkkOvPqjYwHZgeCfI4HbGB8vRsPc7uUE,1984
70
+ huggingface_hub/inference/_generated/types/text_to_speech.py,sha256=Kc42sG1ybdhHn7Jo-t69FqVCxQ7aBhPnjh_4HyuEjW0,4937
71
+ huggingface_hub/inference/_generated/types/token_classification.py,sha256=C0K5OukrNTyvZE-AdIbblacTtyc1Ita374bwfNw2Y-8,1894
72
+ huggingface_hub/inference/_generated/types/translation.py,sha256=AYfr0n-o0HsK21QNs0HMufI1wCMbtRhAZvNK40hjAYk,1742
73
+ huggingface_hub/inference/_generated/types/video_classification.py,sha256=e6J5BNqQ5gtyHAuVB-UPo4RYy4AIT6XSShhGA13CB_E,1659
74
+ huggingface_hub/inference/_generated/types/visual_question_answering.py,sha256=OgjxhaZ42Q3pX5S7e1CGHVNKg9-wZpdhuylkylds57Y,1641
75
+ huggingface_hub/inference/_generated/types/zero_shot_classification.py,sha256=XysOHfPIx6V3jBuUM1P0QM4UjpkGQV816awIN_W5Oqk,1717
76
+ huggingface_hub/inference/_generated/types/zero_shot_image_classification.py,sha256=sXIYvmrX0DreSfjERDKeY9iTFV8Zg_UEo6m5xsOsInE,1466
77
+ huggingface_hub/inference/_generated/types/zero_shot_object_detection.py,sha256=LFtdjPxuEMsEcCqqrJETV05t9bz4CpdYMfU2a-eBvl4,1598
78
+ huggingface_hub/serialization/__init__.py,sha256=kn-Fa-m4FzMnN8lNsF-SwFcfzug4CucexybGKyvZ8S0,1041
80
79
  huggingface_hub/serialization/_base.py,sha256=JZneES-HgcRH9C2SQehIGRDtT7nS7emu-RRV4ZjB6xo,8124
80
+ huggingface_hub/serialization/_dduf.py,sha256=s42239rLiHwaJE36QDEmS5GH7DSmQ__BffiHJO5RjIg,15424
81
81
  huggingface_hub/serialization/_tensorflow.py,sha256=zHOvEMg-JHC55Fm4roDT3LUCDO5zB9qtXZffG065RAM,3625
82
- huggingface_hub/serialization/_torch.py,sha256=i6UFAHk1MDx_RONaXYolsISVa0V3a_YH-bdQtCYnmtg,26498
82
+ huggingface_hub/serialization/_torch.py,sha256=fX3KHMkW3h9eOm5wGvmNeAq3GU5lxq9db5c57kSX77k,44717
83
83
  huggingface_hub/templates/datasetcard_template.md,sha256=W-EMqR6wndbrnZorkVv56URWPG49l7MATGeI015kTvs,5503
84
84
  huggingface_hub/templates/modelcard_template.md,sha256=4AqArS3cqdtbit5Bo-DhjcnDFR-pza5hErLLTPM4Yuc,6870
85
85
  huggingface_hub/utils/__init__.py,sha256=aMEsiXGi93z-dXz1W7FFma71tAMeKw0SoKVZSQUeE_4,3525
86
86
  huggingface_hub/utils/_auth.py,sha256=-9p3SSOtWKMMCDKlsM_-ebsIGX0sSgKTSnC-_O4kTxg,8294
87
87
  huggingface_hub/utils/_cache_assets.py,sha256=kai77HPQMfYpROouMBQCr_gdBCaeTm996Sqj0dExbNg,5728
88
- huggingface_hub/utils/_cache_manager.py,sha256=kfuZDQy6FbWXrwKqp5sAJHte1BooTYKnjyuS0kbR6Eo,34495
88
+ huggingface_hub/utils/_cache_manager.py,sha256=GhiuVQsEkWU55uYkkgiGJV1_naeciyk8u4qb4WTIVyw,34531
89
89
  huggingface_hub/utils/_chunk_utils.py,sha256=kRCaj5228_vKcyLWspd8Xq01f17Jz6ds5Sr9ed5d_RU,2130
90
90
  huggingface_hub/utils/_datetime.py,sha256=kCS5jaKV25kOncX1xujbXsz5iDLcjLcLw85semGNzxQ,2770
91
91
  huggingface_hub/utils/_deprecation.py,sha256=HZhRGGUX_QMKBBBwHHlffLtmCSK01TOpeXHefZbPfwI,4872
92
92
  huggingface_hub/utils/_experimental.py,sha256=crCPH6k6-11wwH2GZuZzZzZbjUotay49ywV1SSJhMHM,2395
93
93
  huggingface_hub/utils/_fixes.py,sha256=C-feEQOZtXGHP4E2Qlg2VyxWSZhdCVmd0_B6zgiPcWA,4045
94
94
  huggingface_hub/utils/_git_credential.py,sha256=SDdsiREr1TcAR2Ze2TB0E5cYzVJgvDZrs60od9lAsMc,4596
95
- huggingface_hub/utils/_headers.py,sha256=qZY8SQAFq3b7MaxQmZdSvNy6OuPyIBElL1Zvfa5sC8k,9592
95
+ huggingface_hub/utils/_headers.py,sha256=A-OYkrVG8LQGgeNq79rIbPD0ovHBibnoASoxJESzeuY,8698
96
96
  huggingface_hub/utils/_hf_folder.py,sha256=cffdBqvvk0E_DW9rkaaVXLYOTFsOREDB_Y98evp_nWI,3612
97
97
  huggingface_hub/utils/_http.py,sha256=-dfsV0Bs9pb8EStpcJvDGOfp_sKYD-re-XbIVITVAyo,22670
98
98
  huggingface_hub/utils/_lfs.py,sha256=EC0Oz6Wiwl8foRNkUOzrETXzAWlbgpnpxo5a410ovFY,3957
@@ -108,10 +108,10 @@ huggingface_hub/utils/endpoint_helpers.py,sha256=9VtIAlxQ5H_4y30sjCAgbu7XCqAtNLC
108
108
  huggingface_hub/utils/insecure_hashlib.py,sha256=OjxlvtSQHpbLp9PWSrXBDJ0wHjxCBU-SQJgucEEXDbU,1058
109
109
  huggingface_hub/utils/logging.py,sha256=Cp03s0uEl3kDM9XHQW9a8GAoExODQ-e7kEtgMt-_To8,4728
110
110
  huggingface_hub/utils/sha.py,sha256=OFnNGCba0sNcT2gUwaVCJnldxlltrHHe0DS_PCpV3C4,2134
111
- huggingface_hub/utils/tqdm.py,sha256=jQiVYwRG78HK4_54u0vTtz6Kt9IMGiHy3ixbIn3h2TU,9368
112
- huggingface_hub-0.26.3.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
113
- huggingface_hub-0.26.3.dist-info/METADATA,sha256=xeabjkgCLGRol8NXGS0ftagVPKUfTaq2iaKfd_k5P9M,13091
114
- huggingface_hub-0.26.3.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
115
- huggingface_hub-0.26.3.dist-info/entry_points.txt,sha256=Y3Z2L02rBG7va_iE6RPXolIgwOdwUFONyRN3kXMxZ0g,131
116
- huggingface_hub-0.26.3.dist-info/top_level.txt,sha256=8KzlQJAY4miUvjAssOAJodqKOw3harNzuiwGQ9qLSSk,16
117
- huggingface_hub-0.26.3.dist-info/RECORD,,
111
+ huggingface_hub/utils/tqdm.py,sha256=ZgdphuTnwAIaUKnnD2P7qVvNHpzHAyrYoItkiV0aEjQ,9835
112
+ huggingface_hub-0.27.0rc1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
113
+ huggingface_hub-0.27.0rc1.dist-info/METADATA,sha256=ghGQcW1I5xPEpo-wovfTYY6nmwatvRrPtscd_fKJPiI,13483
114
+ huggingface_hub-0.27.0rc1.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
115
+ huggingface_hub-0.27.0rc1.dist-info/entry_points.txt,sha256=Y3Z2L02rBG7va_iE6RPXolIgwOdwUFONyRN3kXMxZ0g,131
116
+ huggingface_hub-0.27.0rc1.dist-info/top_level.txt,sha256=8KzlQJAY4miUvjAssOAJodqKOw3harNzuiwGQ9qLSSk,16
117
+ huggingface_hub-0.27.0rc1.dist-info/RECORD,,
@@ -1,306 +0,0 @@
1
- # coding=utf-8
2
- # Copyright 2023-present, the HuggingFace Inc. team.
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
- """Contains utilities to multi-commits (i.e. push changes iteratively on a PR)."""
16
-
17
- import re
18
- from dataclasses import dataclass, field
19
- from typing import TYPE_CHECKING, Iterable, List, Optional, Set, Tuple, Union
20
-
21
- from ._commit_api import CommitOperationAdd, CommitOperationDelete
22
- from .community import DiscussionWithDetails
23
- from .utils import experimental
24
- from .utils._cache_manager import _format_size
25
- from .utils.insecure_hashlib import sha256
26
-
27
-
28
- if TYPE_CHECKING:
29
- from .hf_api import HfApi
30
-
31
-
32
- class MultiCommitException(Exception):
33
- """Base exception for any exception happening while doing a multi-commit."""
34
-
35
-
36
- MULTI_COMMIT_PR_DESCRIPTION_TEMPLATE = """
37
- ## {commit_message}
38
-
39
- {commit_description}
40
-
41
- **Multi commit ID:** {multi_commit_id}
42
-
43
- Scheduled commits:
44
-
45
- {multi_commit_strategy}
46
-
47
- _This is a PR opened using the `huggingface_hub` library in the context of a multi-commit. PR can be commented as a usual PR. However, please be aware that manually updating the PR description, changing the PR status, or pushing new commits, is not recommended as it might corrupt the commit process. Learn more about multi-commits [in this guide](https://huggingface.co/docs/huggingface_hub/main/guides/upload)._
48
- """
49
-
50
- MULTI_COMMIT_PR_COMPLETION_COMMENT_TEMPLATE = """
51
- Multi-commit is now completed! You can ping the repo owner to review the changes. This PR can now be commented or modified without risking to corrupt it.
52
-
53
- _This is a comment posted using the `huggingface_hub` library in the context of a multi-commit. Learn more about multi-commits [in this guide](https://huggingface.co/docs/huggingface_hub/main/guides/upload)._
54
- """
55
-
56
- MULTI_COMMIT_PR_CLOSING_COMMENT_TEMPLATE = """
57
- `create_pr=False` has been passed so PR is automatically merged.
58
-
59
- _This is a comment posted using the `huggingface_hub` library in the context of a multi-commit. Learn more about multi-commits [in this guide](https://huggingface.co/docs/huggingface_hub/main/guides/upload)._
60
- """
61
-
62
- MULTI_COMMIT_PR_CLOSE_COMMENT_FAILURE_NO_CHANGES_TEMPLATE = """
63
- Cannot merge Pull Requests as no changes are associated. This PR will be closed automatically.
64
-
65
- _This is a comment posted using the `huggingface_hub` library in the context of a multi-commit. Learn more about multi-commits [in this guide](https://huggingface.co/docs/huggingface_hub/main/guides/upload)._
66
- """
67
-
68
- MULTI_COMMIT_PR_CLOSE_COMMENT_FAILURE_BAD_REQUEST_TEMPLATE = """
69
- An error occurred while trying to merge the Pull Request: `{error_message}`.
70
-
71
- _This is a comment posted using the `huggingface_hub` library in the context of a multi-commit. Learn more about multi-commits [in this guide](https://huggingface.co/docs/huggingface_hub/main/guides/upload)._
72
- """
73
-
74
-
75
- STEP_ID_REGEX = re.compile(r"- \[(?P<completed>[ |x])\].*(?P<step_id>[a-fA-F0-9]{64})", flags=re.MULTILINE)
76
-
77
-
78
- @experimental
79
- def plan_multi_commits(
80
- operations: Iterable[Union[CommitOperationAdd, CommitOperationDelete]],
81
- max_operations_per_commit: int = 50,
82
- max_upload_size_per_commit: int = 2 * 1024 * 1024 * 1024,
83
- ) -> Tuple[List[List[CommitOperationAdd]], List[List[CommitOperationDelete]]]:
84
- """Split a list of operations in a list of commits to perform.
85
-
86
- Implementation follows a sub-optimal (yet simple) algorithm:
87
- 1. Delete operations are grouped together by commits of maximum `max_operations_per_commits` operations.
88
- 2. All additions exceeding `max_upload_size_per_commit` are committed 1 by 1.
89
- 3. All remaining additions are grouped together and split each time the `max_operations_per_commit` or the
90
- `max_upload_size_per_commit` limit is reached.
91
-
92
- We do not try to optimize the splitting to get the lowest number of commits as this is a NP-hard problem (see
93
- [bin packing problem](https://en.wikipedia.org/wiki/Bin_packing_problem)). For our use case, it is not problematic
94
- to use a sub-optimal solution so we favored an easy-to-explain implementation.
95
-
96
- Args:
97
- operations (`List` of [`~hf_api.CommitOperation`]):
98
- The list of operations to split into commits.
99
- max_operations_per_commit (`int`):
100
- Maximum number of operations in a single commit. Defaults to 50.
101
- max_upload_size_per_commit (`int`):
102
- Maximum size to upload (in bytes) in a single commit. Defaults to 2GB. Files bigger than this limit are
103
- uploaded, 1 per commit.
104
-
105
- Returns:
106
- `Tuple[List[List[CommitOperationAdd]], List[List[CommitOperationDelete]]]`: a tuple. First item is a list of
107
- lists of [`CommitOperationAdd`] representing the addition commits to push. The second item is a list of lists
108
- of [`CommitOperationDelete`] representing the deletion commits.
109
-
110
- <Tip warning={true}>
111
-
112
- `plan_multi_commits` is experimental. Its API and behavior is subject to change in the future without prior notice.
113
-
114
- </Tip>
115
-
116
- Example:
117
- ```python
118
- >>> from huggingface_hub import HfApi, plan_multi_commits
119
- >>> addition_commits, deletion_commits = plan_multi_commits(
120
- ... operations=[
121
- ... CommitOperationAdd(...),
122
- ... CommitOperationAdd(...),
123
- ... CommitOperationDelete(...),
124
- ... CommitOperationDelete(...),
125
- ... CommitOperationAdd(...),
126
- ... ],
127
- ... )
128
- >>> HfApi().create_commits_on_pr(
129
- ... repo_id="my-cool-model",
130
- ... addition_commits=addition_commits,
131
- ... deletion_commits=deletion_commits,
132
- ... (...)
133
- ... verbose=True,
134
- ... )
135
- ```
136
-
137
- <Tip warning={true}>
138
-
139
- The initial order of the operations is not guaranteed! All deletions will be performed before additions. If you are
140
- not updating multiple times the same file, you are fine.
141
-
142
- </Tip>
143
- """
144
- addition_commits: List[List[CommitOperationAdd]] = []
145
- deletion_commits: List[List[CommitOperationDelete]] = []
146
-
147
- additions: List[CommitOperationAdd] = []
148
- additions_size = 0
149
- deletions: List[CommitOperationDelete] = []
150
- for op in operations:
151
- if isinstance(op, CommitOperationDelete):
152
- # Group delete operations together
153
- deletions.append(op)
154
- if len(deletions) >= max_operations_per_commit:
155
- deletion_commits.append(deletions)
156
- deletions = []
157
-
158
- elif op.upload_info.size >= max_upload_size_per_commit:
159
- # Upload huge files 1 by 1
160
- addition_commits.append([op])
161
-
162
- elif additions_size + op.upload_info.size < max_upload_size_per_commit:
163
- # Group other additions and split if size limit is reached (either max_nb_files or max_upload_size)
164
- additions.append(op)
165
- additions_size += op.upload_info.size
166
-
167
- else:
168
- addition_commits.append(additions)
169
- additions = [op]
170
- additions_size = op.upload_info.size
171
-
172
- if len(additions) >= max_operations_per_commit:
173
- addition_commits.append(additions)
174
- additions = []
175
- additions_size = 0
176
-
177
- if len(additions) > 0:
178
- addition_commits.append(additions)
179
- if len(deletions) > 0:
180
- deletion_commits.append(deletions)
181
-
182
- return addition_commits, deletion_commits
183
-
184
-
185
- @dataclass
186
- class MultiCommitStep:
187
- """Dataclass containing a list of CommitOperation to commit at once.
188
-
189
- A [`MultiCommitStep`] is one atomic part of a [`MultiCommitStrategy`]. Each step is identified by its own
190
- deterministic ID based on the list of commit operations (hexadecimal sha256). ID is persistent between re-runs if
191
- the list of commits is kept the same.
192
- """
193
-
194
- operations: List[Union[CommitOperationAdd, CommitOperationDelete]]
195
-
196
- id: str = field(init=False)
197
- completed: bool = False
198
-
199
- def __post_init__(self) -> None:
200
- if len(self.operations) == 0:
201
- raise ValueError("A MultiCommitStep must have at least 1 commit operation, got 0.")
202
-
203
- # Generate commit id
204
- sha = sha256()
205
- for op in self.operations:
206
- if isinstance(op, CommitOperationAdd):
207
- sha.update(b"ADD")
208
- sha.update(op.path_in_repo.encode())
209
- sha.update(op.upload_info.sha256)
210
- elif isinstance(op, CommitOperationDelete):
211
- sha.update(b"DELETE")
212
- sha.update(op.path_in_repo.encode())
213
- sha.update(str(op.is_folder).encode())
214
- else:
215
- NotImplementedError()
216
- self.id = sha.hexdigest()
217
-
218
- def __str__(self) -> str:
219
- """Format a step for PR description.
220
-
221
- Formatting can be changed in the future as long as it is single line, starts with `- [ ]`/`- [x]` and contains
222
- `self.id`. Must be able to match `STEP_ID_REGEX`.
223
- """
224
- additions = [op for op in self.operations if isinstance(op, CommitOperationAdd)]
225
- file_deletions = [op for op in self.operations if isinstance(op, CommitOperationDelete) and not op.is_folder]
226
- folder_deletions = [op for op in self.operations if isinstance(op, CommitOperationDelete) and op.is_folder]
227
- if len(additions) > 0:
228
- return (
229
- f"- [{'x' if self.completed else ' '}] Upload {len(additions)} file(s) "
230
- f"totalling {_format_size(sum(add.upload_info.size for add in additions))}"
231
- f" ({self.id})"
232
- )
233
- else:
234
- return (
235
- f"- [{'x' if self.completed else ' '}] Delete {len(file_deletions)} file(s) and"
236
- f" {len(folder_deletions)} folder(s) ({self.id})"
237
- )
238
-
239
-
240
- @dataclass
241
- class MultiCommitStrategy:
242
- """Dataclass containing a list of [`MultiCommitStep`] to commit iteratively.
243
-
244
- A strategy is identified by its own deterministic ID based on the list of its steps (hexadecimal sha256). ID is
245
- persistent between re-runs if the list of commits is kept the same.
246
- """
247
-
248
- addition_commits: List[MultiCommitStep]
249
- deletion_commits: List[MultiCommitStep]
250
-
251
- id: str = field(init=False)
252
- all_steps: Set[str] = field(init=False)
253
-
254
- def __post_init__(self) -> None:
255
- self.all_steps = {step.id for step in self.addition_commits + self.deletion_commits}
256
- if len(self.all_steps) < len(self.addition_commits) + len(self.deletion_commits):
257
- raise ValueError("Got duplicate commits in MultiCommitStrategy. All commits must be unique.")
258
-
259
- if len(self.all_steps) == 0:
260
- raise ValueError("A MultiCommitStrategy must have at least 1 commit, got 0.")
261
-
262
- # Generate strategy id
263
- sha = sha256()
264
- for step in self.addition_commits + self.deletion_commits:
265
- sha.update("new step".encode())
266
- sha.update(step.id.encode())
267
- self.id = sha.hexdigest()
268
-
269
-
270
- def multi_commit_create_pull_request(
271
- api: "HfApi",
272
- repo_id: str,
273
- commit_message: str,
274
- commit_description: Optional[str],
275
- strategy: MultiCommitStrategy,
276
- repo_type: Optional[str],
277
- token: Union[str, bool, None] = None,
278
- ) -> DiscussionWithDetails:
279
- return api.create_pull_request(
280
- repo_id=repo_id,
281
- title=f"[WIP] {commit_message} (multi-commit {strategy.id})",
282
- description=multi_commit_generate_comment(
283
- commit_message=commit_message, commit_description=commit_description, strategy=strategy
284
- ),
285
- token=token,
286
- repo_type=repo_type,
287
- )
288
-
289
-
290
- def multi_commit_generate_comment(
291
- commit_message: str,
292
- commit_description: Optional[str],
293
- strategy: MultiCommitStrategy,
294
- ) -> str:
295
- return MULTI_COMMIT_PR_DESCRIPTION_TEMPLATE.format(
296
- commit_message=commit_message,
297
- commit_description=commit_description or "",
298
- multi_commit_id=strategy.id,
299
- multi_commit_strategy="\n".join(
300
- str(commit) for commit in strategy.deletion_commits + strategy.addition_commits
301
- ),
302
- )
303
-
304
-
305
- def multi_commit_parse_pr_description(description: str) -> Set[str]:
306
- return {match[1] for match in STEP_ID_REGEX.findall(description)}