huggingface-hub 0.19.0rc0__tar.gz → 0.19.2__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.

Files changed (81) hide show
  1. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/PKG-INFO +1 -1
  2. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/__init__.py +1 -1
  3. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/constants.py +5 -4
  4. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/repocard.py +2 -4
  5. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/repocard_data.py +4 -8
  6. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub.egg-info/PKG-INFO +1 -1
  7. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/LICENSE +0 -0
  8. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/MANIFEST.in +0 -0
  9. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/README.md +0 -0
  10. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/pyproject.toml +0 -0
  11. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/setup.cfg +0 -0
  12. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/setup.py +0 -0
  13. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/_commit_api.py +0 -0
  14. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/_commit_scheduler.py +0 -0
  15. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/_inference_endpoints.py +0 -0
  16. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/_login.py +0 -0
  17. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/_multi_commits.py +0 -0
  18. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/_snapshot_download.py +0 -0
  19. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/_space_api.py +0 -0
  20. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/_tensorboard_logger.py +0 -0
  21. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/_webhooks_payload.py +0 -0
  22. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/_webhooks_server.py +0 -0
  23. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/commands/__init__.py +0 -0
  24. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/commands/_cli_utils.py +0 -0
  25. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/commands/delete_cache.py +0 -0
  26. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/commands/download.py +0 -0
  27. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/commands/env.py +0 -0
  28. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/commands/huggingface_cli.py +0 -0
  29. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/commands/lfs.py +0 -0
  30. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/commands/scan_cache.py +0 -0
  31. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/commands/upload.py +0 -0
  32. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/commands/user.py +0 -0
  33. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/community.py +0 -0
  34. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/fastai_utils.py +0 -0
  35. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/file_download.py +0 -0
  36. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/hf_api.py +0 -0
  37. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/hf_file_system.py +0 -0
  38. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/hub_mixin.py +0 -0
  39. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/inference/__init__.py +0 -0
  40. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/inference/_client.py +0 -0
  41. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/inference/_common.py +0 -0
  42. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/inference/_generated/__init__.py +0 -0
  43. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/inference/_generated/_async_client.py +0 -0
  44. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/inference/_text_generation.py +0 -0
  45. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/inference/_types.py +0 -0
  46. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/inference_api.py +0 -0
  47. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/keras_mixin.py +0 -0
  48. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/lfs.py +0 -0
  49. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/repository.py +0 -0
  50. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/templates/datasetcard_template.md +0 -0
  51. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/templates/modelcard_template.md +0 -0
  52. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/utils/__init__.py +0 -0
  53. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/utils/_cache_assets.py +0 -0
  54. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/utils/_cache_manager.py +0 -0
  55. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/utils/_chunk_utils.py +0 -0
  56. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/utils/_datetime.py +0 -0
  57. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/utils/_deprecation.py +0 -0
  58. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/utils/_errors.py +0 -0
  59. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/utils/_experimental.py +0 -0
  60. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/utils/_fixes.py +0 -0
  61. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/utils/_git_credential.py +0 -0
  62. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/utils/_headers.py +0 -0
  63. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/utils/_hf_folder.py +0 -0
  64. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/utils/_http.py +0 -0
  65. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/utils/_pagination.py +0 -0
  66. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/utils/_paths.py +0 -0
  67. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/utils/_runtime.py +0 -0
  68. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/utils/_subprocess.py +0 -0
  69. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/utils/_telemetry.py +0 -0
  70. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/utils/_typing.py +0 -0
  71. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/utils/_validators.py +0 -0
  72. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/utils/endpoint_helpers.py +0 -0
  73. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/utils/insecure_hashlib.py +0 -0
  74. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/utils/logging.py +0 -0
  75. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/utils/sha.py +0 -0
  76. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub/utils/tqdm.py +0 -0
  77. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub.egg-info/SOURCES.txt +0 -0
  78. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub.egg-info/dependency_links.txt +0 -0
  79. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub.egg-info/entry_points.txt +0 -0
  80. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/src/huggingface_hub.egg-info/requires.txt +0 -0
  81. {huggingface_hub-0.19.0rc0 → huggingface_hub-0.19.2}/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.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.
@@ -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.