huggingface-hub 0.19.0rc0__py3-none-any.whl → 0.19.2__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__ = "0.19.0.rc0"
49
+ __version__ = "0.19.2"
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
@@ -82,15 +82,16 @@ REPO_TYPES_MAPPING = {
82
82
 
83
83
  # default cache
84
84
  default_home = os.path.join(os.path.expanduser("~"), ".cache")
85
- hf_cache_home = os.path.expanduser(
85
+ HF_HOME = os.path.expanduser(
86
86
  os.getenv(
87
87
  "HF_HOME",
88
88
  os.path.join(os.getenv("XDG_CACHE_HOME", default_home), "huggingface"),
89
89
  )
90
90
  )
91
+ hf_cache_home = HF_HOME # for backward compatibility. TODO: remove this in 1.0.0
91
92
 
92
- default_cache_path = os.path.join(hf_cache_home, "hub")
93
- default_assets_cache_path = os.path.join(hf_cache_home, "assets")
93
+ default_cache_path = os.path.join(HF_HOME, "hub")
94
+ default_assets_cache_path = os.path.join(HF_HOME, "assets")
94
95
 
95
96
  # Legacy env variables
96
97
  HUGGINGFACE_HUB_CACHE = os.getenv("HUGGINGFACE_HUB_CACHE", default_cache_path)
@@ -109,7 +110,7 @@ HF_HUB_DISABLE_TELEMETRY = _is_true(os.environ.get("HF_HUB_DISABLE_TELEMETRY") o
109
110
  # `_OLD_HF_TOKEN_PATH` is deprecated and will be removed "at some point".
110
111
  # See https://github.com/huggingface/huggingface_hub/issues/1232
111
112
  _OLD_HF_TOKEN_PATH = os.path.expanduser("~/.huggingface/token")
112
- HF_TOKEN_PATH = os.path.join(hf_cache_home, "token")
113
+ HF_TOKEN_PATH = os.path.join(HF_HOME, "token")
113
114
 
114
115
 
115
116
  if _staging_mode:
@@ -1,5 +1,6 @@
1
1
  import os
2
2
  import re
3
+ import warnings
3
4
  from pathlib import Path
4
5
  from typing import Any, Dict, Literal, Optional, Type, Union
5
6
 
@@ -21,7 +22,6 @@ from huggingface_hub.utils import get_session, is_jinja_available, yaml_dump
21
22
 
22
23
  from .constants import REPOCARD_NAME
23
24
  from .utils import EntryNotFoundError, SoftTemporaryDirectory, validate_hf_hub_args
24
- from .utils.logging import get_logger
25
25
 
26
26
 
27
27
  TEMPLATE_MODELCARD_PATH = Path(__file__).parent / "templates" / "modelcard_template.md"
@@ -31,8 +31,6 @@ TEMPLATE_DATASETCARD_PATH = Path(__file__).parent / "templates" / "datasetcard_t
31
31
  # See https://github.com/huggingface/moon-landing/blob/main/server/lib/ViewMarkdown.ts#L18
32
32
  REGEX_YAML_BLOCK = re.compile(r"^(\s*---[\r\n]+)([\S\s]*?)([\r\n]+---(\r\n|\n|$))")
33
33
 
34
- logger = get_logger(__name__)
35
-
36
34
 
37
35
  class RepoCard:
38
36
  card_data_class = CardData
@@ -104,7 +102,7 @@ class RepoCard:
104
102
  raise ValueError("repo card metadata block should be a dict")
105
103
  else:
106
104
  # Model card without metadata... create empty metadata
107
- logger.warning("Repo card metadata block was not found. Setting CardData to empty.")
105
+ warnings.warn("Repo card metadata block was not found. Setting CardData to empty.")
108
106
  data_dict = {}
109
107
  self.text = content
110
108
 
@@ -1,15 +1,11 @@
1
1
  import copy
2
+ import warnings
2
3
  from collections import defaultdict
3
4
  from dataclasses import dataclass
4
5
  from typing import Any, Dict, List, Optional, Tuple, Union
5
6
 
6
7
  from huggingface_hub.utils import yaml_dump
7
8
 
8
- from .utils.logging import get_logger
9
-
10
-
11
- logger = get_logger(__name__)
12
-
13
9
 
14
10
  @dataclass
15
11
  class EvalResult:
@@ -305,12 +301,12 @@ class ModelCardData(CardData):
305
301
  model_name, eval_results = model_index_to_eval_results(model_index)
306
302
  self.model_name = model_name
307
303
  self.eval_results = eval_results
308
- except KeyError as error:
304
+ except (KeyError, TypeError) as error:
309
305
  if ignore_metadata_errors:
310
- logger.warning("Invalid model-index. Not loading eval results into CardData.")
306
+ warnings.warn("Invalid model-index. Not loading eval results into CardData.")
311
307
  else:
312
308
  raise ValueError(
313
- f"Invalid `model_index` in metadata cannot be parsed: KeyError {error}. Pass"
309
+ f"Invalid `model_index` in metadata cannot be parsed: {error.__class__} {error}. Pass"
314
310
  " `ignore_metadata_errors=True` to ignore this error while loading a Model Card. Warning:"
315
311
  " some information will be lost. Use it at your own risk."
316
312
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: huggingface-hub
3
- Version: 0.19.0rc0
3
+ Version: 0.19.2
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.
@@ -1,4 +1,4 @@
1
- huggingface_hub/__init__.py,sha256=gWwOVVRXgAaIa7dHQeXRjM_gsv6CD3OBaIIszpAdSa8,19807
1
+ huggingface_hub/__init__.py,sha256=ZeFbK-g1uL7BSc0XYf_kHGn-RYHfX2UbbjSIRuQpkYo,19803
2
2
  huggingface_hub/_commit_api.py,sha256=2OA0mNhjnVJWuhhKlkLcQQxGtnJhZ0RX1wRg0eOcgFM,26108
3
3
  huggingface_hub/_commit_scheduler.py,sha256=FgfjYv3E0oK3iBxDdy45Y7t78FWkmjnBR4dRd5aZviU,13653
4
4
  huggingface_hub/_inference_endpoints.py,sha256=0ZNCntMfYgrKmnhLC_fPRRcaXQxpA7fkZ6250X3ZXz4,13853
@@ -10,7 +10,7 @@ huggingface_hub/_tensorboard_logger.py,sha256=3W8eUS3jhZ3WyVG9Hi6rVwZC-jcCyRunBn
10
10
  huggingface_hub/_webhooks_payload.py,sha256=0v4VuOXYt9sshqPi96I1ymALkiyGWBYqX2KSAxGrqUU,2803
11
11
  huggingface_hub/_webhooks_server.py,sha256=2wETO28XU2NSLnG-ardYbcLCuVbPL8e_Pl83_4-MngA,14757
12
12
  huggingface_hub/community.py,sha256=FTuDzikTckQKCU29ZoeEHCg_qRXEqqdiPY3_dIiTsAo,12088
13
- huggingface_hub/constants.py,sha256=4uJitslom26sZnhesezZi44KVlIRGfmdlFzQ6E7sj6s,6938
13
+ huggingface_hub/constants.py,sha256=GqGDNcZH_UgrZMNqkOgMlSQoIBPd0qr-2QlCZgJ4ZT0,6996
14
14
  huggingface_hub/fastai_utils.py,sha256=5I7zAfgHJU_mZnxnf9wgWTHrCRu_EAV8VTangDVfE_o,16676
15
15
  huggingface_hub/file_download.py,sha256=e2uff9eYmuQRBE5TObvZgzT6l4KoJmqKL80BziNRx0k,74545
16
16
  huggingface_hub/hf_api.py,sha256=PW5MLw81kRu5jVzLQaN7HpErvhkBnIRznWOwPO8rFLU,297182
@@ -19,8 +19,8 @@ huggingface_hub/hub_mixin.py,sha256=_LA7RdQMpzqSigaCp6xPlB8ZxmFa3SDmW8RGJP0D7zQ,
19
19
  huggingface_hub/inference_api.py,sha256=UXOKu_Ez2I3hDsjguqCcCrj03WFDndehpngYiIAucdg,8331
20
20
  huggingface_hub/keras_mixin.py,sha256=BG_Ck_dbaKecW2y2keGXAxVSpPyLACLmWVsd2larcJU,18837
21
21
  huggingface_hub/lfs.py,sha256=prum9TUWYQ4oHIaNCB93MpBi6T3MvCTmMfPKLn1ePj8,18750
22
- huggingface_hub/repocard.py,sha256=xgHKwiz10LKnTBuvU0RJPtx_eDJAuOaPn3JDSO1Qorc,34311
23
- huggingface_hub/repocard_data.py,sha256=KMJv1Pmb_ZvjTbkK8CsUcJd7VYvbPgAOCbLRyEeY0Zs,29758
22
+ huggingface_hub/repocard.py,sha256=kJGupeVIE2eQqo4sOGrUWRf6vOdkKdQtryMdZKNxqoc,34257
23
+ huggingface_hub/repocard_data.py,sha256=Lck5jxCWDVdyEVP3GyCfq2n2ey20rK7h6DSqzZqLzIw,29724
24
24
  huggingface_hub/repository.py,sha256=lmn5HM2Z0GhOqRg6YxrI08jGZsNHN7IfHF5e_btaH2g,54465
25
25
  huggingface_hub/commands/__init__.py,sha256=AkbM2a-iGh0Vq_xAWhK3mu3uZ44km8-X5uWjKcvcrUQ,928
26
26
  huggingface_hub/commands/_cli_utils.py,sha256=VA_3cHzIlsEQmKPnfNTgJNI36UtcrxRmfB44RdbP1LA,1970
@@ -66,9 +66,9 @@ huggingface_hub/utils/insecure_hashlib.py,sha256=OjxlvtSQHpbLp9PWSrXBDJ0wHjxCBU-
66
66
  huggingface_hub/utils/logging.py,sha256=mARNwc5gY6apMQ9IM5zymn-RsYnFbYW3b0HDMYXmBS0,4729
67
67
  huggingface_hub/utils/sha.py,sha256=IVi7CfBthfu-ExLduY_CQltTy-tVGTbrvURCTOWKcLA,901
68
68
  huggingface_hub/utils/tqdm.py,sha256=zBWgoxxwHooOceABVREVqSNpJGcMpaByKFVDU8VbuUQ,6334
69
- huggingface_hub-0.19.0rc0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
70
- huggingface_hub-0.19.0rc0.dist-info/METADATA,sha256=1-h7_ZsxJNs7FnPtST5UTE_0NNTGz1xDUL490PgOuSY,13612
71
- huggingface_hub-0.19.0rc0.dist-info/WHEEL,sha256=Xo9-1PvkuimrydujYJAjF7pCkriuXBpUPEjma1nZyJ0,92
72
- huggingface_hub-0.19.0rc0.dist-info/entry_points.txt,sha256=Y3Z2L02rBG7va_iE6RPXolIgwOdwUFONyRN3kXMxZ0g,131
73
- huggingface_hub-0.19.0rc0.dist-info/top_level.txt,sha256=8KzlQJAY4miUvjAssOAJodqKOw3harNzuiwGQ9qLSSk,16
74
- huggingface_hub-0.19.0rc0.dist-info/RECORD,,
69
+ huggingface_hub-0.19.2.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
70
+ huggingface_hub-0.19.2.dist-info/METADATA,sha256=HvCX4ta2nJMEphZBU78A3LA3_JdBQMjQlEMPbH_jX5w,13609
71
+ huggingface_hub-0.19.2.dist-info/WHEEL,sha256=Xo9-1PvkuimrydujYJAjF7pCkriuXBpUPEjma1nZyJ0,92
72
+ huggingface_hub-0.19.2.dist-info/entry_points.txt,sha256=Y3Z2L02rBG7va_iE6RPXolIgwOdwUFONyRN3kXMxZ0g,131
73
+ huggingface_hub-0.19.2.dist-info/top_level.txt,sha256=8KzlQJAY4miUvjAssOAJodqKOw3harNzuiwGQ9qLSSk,16
74
+ huggingface_hub-0.19.2.dist-info/RECORD,,