huggingface-hub 1.0.0rc7__py3-none-any.whl → 1.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of huggingface-hub might be problematic. Click here for more details.

@@ -46,7 +46,7 @@ import sys
46
46
  from typing import TYPE_CHECKING
47
47
 
48
48
 
49
- __version__ = "1.0.0.rc7"
49
+ __version__ = "1.0.1"
50
50
 
51
51
  # Alphabetical order of definitions is ensured in tests
52
52
  # WARNING: any comment added in this dictionary definition will be lost when
@@ -237,6 +237,7 @@ _SUBMOD_ATTRS = {
237
237
  "list_lfs_files",
238
238
  "list_liked_repos",
239
239
  "list_models",
240
+ "list_organization_followers",
240
241
  "list_organization_members",
241
242
  "list_papers",
242
243
  "list_pending_access_requests",
@@ -893,6 +894,7 @@ __all__ = [
893
894
  "list_lfs_files",
894
895
  "list_liked_repos",
895
896
  "list_models",
897
+ "list_organization_followers",
896
898
  "list_organization_members",
897
899
  "list_papers",
898
900
  "list_pending_access_requests",
@@ -1249,6 +1251,7 @@ if TYPE_CHECKING: # pragma: no cover
1249
1251
  list_lfs_files, # noqa: F401
1250
1252
  list_liked_repos, # noqa: F401
1251
1253
  list_models, # noqa: F401
1254
+ list_organization_followers, # noqa: F401
1252
1255
  list_organization_members, # noqa: F401
1253
1256
  list_papers, # noqa: F401
1254
1257
  list_pending_access_requests, # noqa: F401
huggingface_hub/hf_api.py CHANGED
@@ -392,7 +392,7 @@ class CommitInfo(str):
392
392
 
393
393
  # Computed from `pr_url` in `__post_init__`
394
394
  pr_revision: Optional[str] = field(init=False)
395
- pr_num: Optional[str] = field(init=False)
395
+ pr_num: Optional[int] = field(init=False)
396
396
 
397
397
  def __new__(cls, *args, commit_url: str, **kwargs):
398
398
  return str.__new__(cls, commit_url)
@@ -3623,11 +3623,6 @@ class HfApi:
3623
3623
  if provided_space_args:
3624
3624
  warnings.warn(f"Ignoring provided {', '.join(provided_space_args)} because repo_type is not 'space'.")
3625
3625
 
3626
- if getattr(self, "_lfsmultipartthresh", None):
3627
- # Testing purposes only.
3628
- # See https://github.com/huggingface/huggingface_hub/pull/733/files#r820604472
3629
- json["lfsmultipartthresh"] = self._lfsmultipartthresh # type: ignore
3630
-
3631
3626
  if resource_group_id is not None:
3632
3627
  json["resourceGroupId"] = resource_group_id
3633
3628
 
@@ -9528,6 +9523,35 @@ class HfApi:
9528
9523
  hf_raise_for_status(r)
9529
9524
  return Organization(**r.json())
9530
9525
 
9526
+ @validate_hf_hub_args
9527
+ def list_organization_followers(self, organization: str, token: Union[bool, str, None] = None) -> Iterable[User]:
9528
+ """
9529
+ List followers of an organization on the Hub.
9530
+
9531
+ Args:
9532
+ organization (`str`):
9533
+ Name of the organization to get the followers of.
9534
+ token (`bool` or `str`, *optional*):
9535
+ A valid user access token (string). Defaults to the locally saved
9536
+ token, which is the recommended method for authentication (see
9537
+ https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
9538
+ To disable authentication, pass `False`.
9539
+
9540
+ Returns:
9541
+ `Iterable[User]`: A list of [`User`] objects with the followers of the organization.
9542
+
9543
+ Raises:
9544
+ [`HfHubHTTPError`]:
9545
+ HTTP 404 If the organization does not exist on the Hub.
9546
+
9547
+ """
9548
+ for follower in paginate(
9549
+ path=f"{constants.ENDPOINT}/api/organizations/{organization}/followers",
9550
+ params={},
9551
+ headers=self._build_hf_headers(token=token),
9552
+ ):
9553
+ yield User(**follower)
9554
+
9531
9555
  def list_organization_members(self, organization: str, token: Union[bool, str, None] = None) -> Iterable[User]:
9532
9556
  """
9533
9557
  List of members of an organization on the Hub.
@@ -10819,6 +10843,7 @@ update_webhook = api.update_webhook
10819
10843
  # User API
10820
10844
  get_user_overview = api.get_user_overview
10821
10845
  get_organization_overview = api.get_organization_overview
10846
+ list_organization_followers = api.list_organization_followers
10822
10847
  list_organization_members = api.list_organization_members
10823
10848
  list_user_followers = api.list_user_followers
10824
10849
  list_user_following = api.list_user_following
@@ -660,7 +660,7 @@ class HfFileSystem(fsspec.AbstractFileSystem):
660
660
  Returns:
661
661
  `datetime`: Last commit date of the file.
662
662
  """
663
- info = self.info(path, **{**kwargs, "expand_info": True})
663
+ info = self.info(path, **{**kwargs, "expand_info": True}) # type: ignore
664
664
  return info["last_commit"]["date"]
665
665
 
666
666
  def info(self, path: str, refresh: bool = False, revision: Optional[str] = None, **kwargs) -> dict[str, Any]:
@@ -35,7 +35,7 @@ from huggingface_hub.errors import (
35
35
  ValidationError,
36
36
  )
37
37
 
38
- from ..utils import get_session, is_aiohttp_available, is_numpy_available, is_pillow_available
38
+ from ..utils import get_session, is_numpy_available, is_pillow_available
39
39
  from ._generated.types import ChatCompletionStreamOutput, TextGenerationStreamOutput
40
40
 
41
41
 
@@ -91,15 +91,6 @@ class MimeBytes(bytes):
91
91
  ## IMPORT UTILS
92
92
 
93
93
 
94
- def _import_aiohttp():
95
- # Make sure `aiohttp` is installed on the machine.
96
- if not is_aiohttp_available():
97
- raise ImportError("Please install aiohttp to use `AsyncInferenceClient` (`pip install aiohttp`).")
98
- import aiohttp
99
-
100
- return aiohttp
101
-
102
-
103
94
  def _import_numpy():
104
95
  """Make sure `numpy` is installed on the machine."""
105
96
  if not is_numpy_available():
@@ -387,7 +387,7 @@ class ModelCardData(CardData):
387
387
  def _to_dict(self, data_dict):
388
388
  """Format the internal data dict. In this case, we convert eval results to a valid model index"""
389
389
  if self.eval_results is not None:
390
- data_dict["model-index"] = eval_results_to_model_index(self.model_name, self.eval_results)
390
+ data_dict["model-index"] = eval_results_to_model_index(self.model_name, self.eval_results) # type: ignore
391
391
  del data_dict["eval_results"], data_dict["model_name"]
392
392
 
393
393
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: huggingface-hub
3
- Version: 1.0.0rc7
3
+ Version: 1.0.1
4
4
  Summary: Client library to download and publish models, datasets and other repos on the huggingface.co hub
5
5
  Home-page: https://github.com/huggingface/huggingface_hub
6
6
  Author: Hugging Face, Inc.
@@ -33,9 +33,8 @@ Requires-Dist: shellingham
33
33
  Requires-Dist: tqdm>=4.42.1
34
34
  Requires-Dist: typer-slim
35
35
  Requires-Dist: typing-extensions>=3.7.4.3
36
- Requires-Dist: hf-xet<2.0.0,>=1.1.3; platform_machine == "x86_64" or platform_machine == "amd64" or platform_machine == "arm64" or platform_machine == "aarch64"
36
+ Requires-Dist: hf-xet<2.0.0,>=1.2.0; platform_machine == "x86_64" or platform_machine == "amd64" or platform_machine == "AMD64" or platform_machine == "arm64" or platform_machine == "aarch64"
37
37
  Provides-Extra: all
38
- Requires-Dist: aiohttp; extra == "all"
39
38
  Requires-Dist: authlib>=1.3.2; extra == "all"
40
39
  Requires-Dist: fastapi; extra == "all"
41
40
  Requires-Dist: httpx; extra == "all"
@@ -66,7 +65,6 @@ Requires-Dist: types-toml; extra == "all"
66
65
  Requires-Dist: types-tqdm; extra == "all"
67
66
  Requires-Dist: types-urllib3; extra == "all"
68
67
  Provides-Extra: dev
69
- Requires-Dist: aiohttp; extra == "dev"
70
68
  Requires-Dist: authlib>=1.3.2; extra == "dev"
71
69
  Requires-Dist: fastapi; extra == "dev"
72
70
  Requires-Dist: httpx; extra == "dev"
@@ -102,12 +100,9 @@ Requires-Dist: fastai>=2.4; extra == "fastai"
102
100
  Requires-Dist: fastcore>=1.3.27; extra == "fastai"
103
101
  Provides-Extra: hf_xet
104
102
  Requires-Dist: hf-xet<2.0.0,>=1.1.3; extra == "hf-xet"
105
- Provides-Extra: inference
106
- Requires-Dist: aiohttp; extra == "inference"
107
103
  Provides-Extra: mcp
108
104
  Requires-Dist: mcp>=1.8.0; extra == "mcp"
109
105
  Requires-Dist: typer; extra == "mcp"
110
- Requires-Dist: aiohttp; extra == "mcp"
111
106
  Provides-Extra: oauth
112
107
  Requires-Dist: authlib>=1.3.2; extra == "oauth"
113
108
  Requires-Dist: fastapi; extra == "oauth"
@@ -119,7 +114,6 @@ Requires-Dist: mypy==1.15.0; extra == "quality"
119
114
  Requires-Dist: libcst>=1.4.0; extra == "quality"
120
115
  Requires-Dist: ty; extra == "quality"
121
116
  Provides-Extra: testing
122
- Requires-Dist: aiohttp; extra == "testing"
123
117
  Requires-Dist: authlib>=1.3.2; extra == "testing"
124
118
  Requires-Dist: fastapi; extra == "testing"
125
119
  Requires-Dist: httpx; extra == "testing"
@@ -1,4 +1,4 @@
1
- huggingface_hub/__init__.py,sha256=8B9FhZUCQ8LBch8eccJ8i41_alEuuTYrbs02G-o8tBk,52242
1
+ huggingface_hub/__init__.py,sha256=2KbzkZy2jVo37vrYB3bd5GqAjvveFBiNzyd2MyzXgZI,52363
2
2
  huggingface_hub/_commit_api.py,sha256=RUTK7SLa10_-AnfQOCY-pcLw_L_LyuGCfjzvpmb6edk,40619
3
3
  huggingface_hub/_commit_scheduler.py,sha256=tqcdWVGJRIxGQtkFHs_AgBdN9ztUjOQSuAhfMAr1ieM,14751
4
4
  huggingface_hub/_inference_endpoints.py,sha256=cGiZg244nIOi2OLTqm4V8-ZUY3O0Rr7NlOmoLeHUIbY,17592
@@ -18,13 +18,13 @@ huggingface_hub/dataclasses.py,sha256=b1lo5BI881Drd7UM_pUrK8zdJdhXOGj4-pHxFS_P4M
18
18
  huggingface_hub/errors.py,sha256=lnXNYKsoJwm_G3377u7aDJGnGwKqCyaiZ1DfjtlzMR8,11411
19
19
  huggingface_hub/fastai_utils.py,sha256=0joRPBUccjFALLCfhQLyD_K8qxGvQiLThKJClwej_JQ,16657
20
20
  huggingface_hub/file_download.py,sha256=NUQ9jQjmp7DWlA6jwvTJ4y1mV4wH0XN4JysWgcCTAnc,78472
21
- huggingface_hub/hf_api.py,sha256=50F-j3pVuMEsCIWRNSvgco7w81Nxscsmq2HBODrkA90,475128
22
- huggingface_hub/hf_file_system.py,sha256=E7qBHIRK3y-GTGYc_sPqnZ785PNVHUfiWGa_XXJEVyQ,49296
21
+ huggingface_hub/hf_api.py,sha256=75iTEnMty3NJMf8FrzSZL6dO5DPnCMz3VFvM672bWP8,476100
22
+ huggingface_hub/hf_file_system.py,sha256=BzmmHqb5_y91-pOqKKMAzOvGmt8nKqp64zFtZPmOcPY,49312
23
23
  huggingface_hub/hub_mixin.py,sha256=xQDBbxjEHVMdb333hCmjsjYsaxU7IICdgZFf8tq0toU,37063
24
24
  huggingface_hub/lfs.py,sha256=_yqqEl3xbzWufgBBJ-vtPx-LUiuZBJpT9AQ9iX0VJ0c,14060
25
25
  huggingface_hub/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
26
26
  huggingface_hub/repocard.py,sha256=-wss1XDYjr88OjwK4Gzi8c-gQwPIHM8qRgxXYgeilUM,34978
27
- huggingface_hub/repocard_data.py,sha256=DLdOKlnQCHOOpU-e_skx0YaHxoqN9ZKIOmmMjHUqb1w,34063
27
+ huggingface_hub/repocard_data.py,sha256=awhSsLRPrcFM9CurB9mrY40H1bE15yzoXDTVL60yD1U,34079
28
28
  huggingface_hub/cli/__init__.py,sha256=A4zmzuHD2OHjQ5zmdfcnsj0JeCzHVPtpzh-wCjInugA,606
29
29
  huggingface_hub/cli/_cli_utils.py,sha256=e9z0qMXpRfrzERi220QTzwkq9jOldVGUVtmoDV-sgYs,5402
30
30
  huggingface_hub/cli/auth.py,sha256=tJcKzQz8_pl0FFl8a-tNjxpK4AFfA38L4oztcXVdcSY,4515
@@ -40,7 +40,7 @@ huggingface_hub/cli/upload.py,sha256=Dpu-syLR6J52U2HM8bJbjAk5PNA2gxAYagjKoRTNSZs
40
40
  huggingface_hub/cli/upload_large_folder.py,sha256=xQuloimQT0PQH6r5urRpLv8M9I99yAWSGM-sbkG2pu8,4470
41
41
  huggingface_hub/inference/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
42
42
  huggingface_hub/inference/_client.py,sha256=KIRstAwRk6RyVe2bk7XsiGV_ZdwegjyU_KIDVzQbmII,157960
43
- huggingface_hub/inference/_common.py,sha256=qS3i2R8Dz_VCb6sWt1ZqnmOt8jxPU6uSxlyq-0_9ytg,15350
43
+ huggingface_hub/inference/_common.py,sha256=nzpqbelLKe5k-yYV5fNZ2bxnPkBWbwl9jwkeKsYtfxs,15067
44
44
  huggingface_hub/inference/_generated/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
45
45
  huggingface_hub/inference/_generated/_async_client.py,sha256=0xu4TCjav_qXbFNhv6-uBMo26UgH-z34jAJGfUj7obE,161170
46
46
  huggingface_hub/inference/_generated/types/__init__.py,sha256=9WvrGQ8aThtKSNzZF06j-CIE2ZuItne8FFnea1p1u38,6557
@@ -144,9 +144,9 @@ huggingface_hub/utils/insecure_hashlib.py,sha256=z3dVUFvdBZ8kQI_8Vzvvlr3ims-EBiY
144
144
  huggingface_hub/utils/logging.py,sha256=N6NXaCcbPbZSF-Oe-TY3ZnmkpmdFVyTOV8ASo-yVXLE,4916
145
145
  huggingface_hub/utils/sha.py,sha256=OFnNGCba0sNcT2gUwaVCJnldxlltrHHe0DS_PCpV3C4,2134
146
146
  huggingface_hub/utils/tqdm.py,sha256=-9gfgNA8bg5v5YBToSuB6noClI3a6YaGeFZP61IWmeY,10662
147
- huggingface_hub-1.0.0rc7.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
148
- huggingface_hub-1.0.0rc7.dist-info/METADATA,sha256=1fnFeH42RplSFpuMLSky5VK-lxtOmL5fea8yLCcA0XM,13709
149
- huggingface_hub-1.0.0rc7.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
150
- huggingface_hub-1.0.0rc7.dist-info/entry_points.txt,sha256=8Dw-X6nV_toOLZqujrhQMj2uTLs4wzV8EIF1y3FlzVs,153
151
- huggingface_hub-1.0.0rc7.dist-info/top_level.txt,sha256=8KzlQJAY4miUvjAssOAJodqKOw3harNzuiwGQ9qLSSk,16
152
- huggingface_hub-1.0.0rc7.dist-info/RECORD,,
147
+ huggingface_hub-1.0.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
148
+ huggingface_hub-1.0.1.dist-info/METADATA,sha256=7SaaqlooGmJCdFQL7G20VryPtInbLcrFeHGQ47X6OVI,13506
149
+ huggingface_hub-1.0.1.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
150
+ huggingface_hub-1.0.1.dist-info/entry_points.txt,sha256=8Dw-X6nV_toOLZqujrhQMj2uTLs4wzV8EIF1y3FlzVs,153
151
+ huggingface_hub-1.0.1.dist-info/top_level.txt,sha256=8KzlQJAY4miUvjAssOAJodqKOw3harNzuiwGQ9qLSSk,16
152
+ huggingface_hub-1.0.1.dist-info/RECORD,,