huggingface-hub 0.28.0__py3-none-any.whl → 0.28.0rc0__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.28.0"
49
+ __version__ = "0.28.0.rc0"
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
huggingface_hub/hf_api.py CHANGED
@@ -3341,7 +3341,7 @@ class HfApi:
3341
3341
  branch = constants.DEFAULT_REVISION
3342
3342
 
3343
3343
  # Prepare request
3344
- url = f"{self.endpoint}/api/{repo_type}s/{repo_id}/super-squash/{quote(branch, safe='')}"
3344
+ url = f"{self.endpoint}/api/{repo_type}s/{repo_id}/super-squash/{branch}"
3345
3345
  headers = self._build_hf_headers(token=token)
3346
3346
  commit_message = commit_message or f"Super-squash branch '{branch}' using huggingface_hub"
3347
3347
 
@@ -4,7 +4,7 @@ from typing import Any, Dict, Optional, Union
4
4
 
5
5
  from huggingface_hub import constants
6
6
  from huggingface_hub.inference._common import RequestParameters, TaskProviderHelper, _as_dict
7
- from huggingface_hub.utils import build_hf_headers, get_session, get_token, logging
7
+ from huggingface_hub.utils import build_hf_headers, get_session, logging
8
8
 
9
9
 
10
10
  logger = logging.get_logger(__name__)
@@ -52,11 +52,7 @@ class FalAITask(TaskProviderHelper, ABC):
52
52
  extra_payload: Optional[Dict[str, Any]] = None,
53
53
  ) -> RequestParameters:
54
54
  if api_key is None:
55
- api_key = get_token()
56
- if api_key is None:
57
- raise ValueError(
58
- "You must provide an api_key to work with fal.ai API or log in with `huggingface-cli login`."
59
- )
55
+ raise ValueError("You must provide an api_key to work with fal.ai API.")
60
56
 
61
57
  mapped_model = self._map_model(model)
62
58
  headers = {
@@ -2,7 +2,7 @@ from typing import Any, Dict, Optional, Union
2
2
 
3
3
  from huggingface_hub import constants
4
4
  from huggingface_hub.inference._common import RequestParameters, TaskProviderHelper, _as_dict
5
- from huggingface_hub.utils import build_hf_headers, get_session, get_token, logging
5
+ from huggingface_hub.utils import build_hf_headers, get_session, logging
6
6
 
7
7
 
8
8
  logger = logging.get_logger(__name__)
@@ -52,11 +52,7 @@ class ReplicateTask(TaskProviderHelper):
52
52
  extra_payload: Optional[Dict[str, Any]] = None,
53
53
  ) -> RequestParameters:
54
54
  if api_key is None:
55
- api_key = get_token()
56
- if api_key is None:
57
- raise ValueError(
58
- "You must provide an api_key to work with Replicate API or log in with `huggingface-cli login`."
59
- )
55
+ raise ValueError("You must provide an api_key to work with Replicate API.")
60
56
 
61
57
  # Route to the proxy if the api_key is a HF TOKEN
62
58
  if api_key.startswith("hf_"):
@@ -2,7 +2,7 @@ from typing import Any, Dict, Optional, Union
2
2
 
3
3
  from huggingface_hub import constants
4
4
  from huggingface_hub.inference._common import RequestParameters, TaskProviderHelper
5
- from huggingface_hub.utils import build_hf_headers, get_token, logging
5
+ from huggingface_hub.utils import build_hf_headers, logging
6
6
 
7
7
 
8
8
  logger = logging.get_logger(__name__)
@@ -44,11 +44,7 @@ class SambanovaConversationalTask(TaskProviderHelper):
44
44
  extra_payload: Optional[Dict[str, Any]] = None,
45
45
  ) -> RequestParameters:
46
46
  if api_key is None:
47
- api_key = get_token()
48
- if api_key is None:
49
- raise ValueError(
50
- "You must provide an api_key to work with Sambanova API or log in with `huggingface-cli login`."
51
- )
47
+ raise ValueError("You must provide an api_key to work with Sambanova API.")
52
48
 
53
49
  # Route to the proxy if the api_key is a HF TOKEN
54
50
  if api_key.startswith("hf_"):
@@ -4,7 +4,7 @@ from typing import Any, Dict, Optional, Union
4
4
 
5
5
  from huggingface_hub import constants
6
6
  from huggingface_hub.inference._common import RequestParameters, TaskProviderHelper, _as_dict
7
- from huggingface_hub.utils import build_hf_headers, get_token, logging
7
+ from huggingface_hub.utils import build_hf_headers, logging
8
8
 
9
9
 
10
10
  logger = logging.get_logger(__name__)
@@ -20,14 +20,16 @@ SUPPORTED_MODELS = {
20
20
  "deepseek-ai/deepseek-llm-67b-chat": "deepseek-ai/deepseek-llm-67b-chat",
21
21
  "google/gemma-2-9b-it": "google/gemma-2-9b-it",
22
22
  "google/gemma-2b-it": "google/gemma-2-27b-it",
23
+ "llava-hf/llava-v1.6-mistral-7b-hf": "llava-hf/llava-v1.6-mistral-7b-hf",
23
24
  "meta-llama/Llama-2-13b-chat-hf": "meta-llama/Llama-2-13b-chat-hf",
25
+ "meta-llama/Llama-2-70b-hf": "meta-llama/Llama-2-70b-hf",
24
26
  "meta-llama/Llama-2-7b-chat-hf": "meta-llama/Llama-2-7b-chat-hf",
25
27
  "meta-llama/Llama-3.2-11B-Vision-Instruct": "meta-llama/Llama-Vision-Free",
26
28
  "meta-llama/Llama-3.2-3B-Instruct": "meta-llama/Llama-3.2-3B-Instruct-Turbo",
27
29
  "meta-llama/Llama-3.2-90B-Vision-Instruct": "meta-llama/Llama-3.2-90B-Vision-Instruct-Turbo",
28
30
  "meta-llama/Llama-3.3-70B-Instruct": "meta-llama/Llama-3.3-70B-Instruct-Turbo",
29
31
  "meta-llama/Meta-Llama-3-70B-Instruct": "meta-llama/Llama-3-70b-chat-hf",
30
- "meta-llama/Meta-Llama-3-8B-Instruct": "meta-llama/Meta-Llama-3-8B-Instruct-Turbo",
32
+ "meta-llama/Meta-Llama-3-8B-Instruct": "togethercomputer/Llama-3-8b-chat-hf-int4",
31
33
  "meta-llama/Meta-Llama-3.1-405B-Instruct": "meta-llama/Llama-3.2-11B-Vision-Instruct-Turbo",
32
34
  "meta-llama/Meta-Llama-3.1-70B-Instruct": "meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo",
33
35
  "meta-llama/Meta-Llama-3.1-8B-Instruct": "meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo",
@@ -46,7 +48,6 @@ SUPPORTED_MODELS = {
46
48
  "scb10x/llama-3-typhoon-v1.5x-70b-instruct-awq": "scb10x/scb10x-llama3-typhoon-v1-5x-4f316",
47
49
  },
48
50
  "text-generation": {
49
- "meta-llama/Llama-2-70b-hf": "meta-llama/Llama-2-70b-hf",
50
51
  "meta-llama/Meta-Llama-3-8B": "meta-llama/Meta-Llama-3-8B",
51
52
  "mistralai/Mixtral-8x7B-v0.1": "mistralai/Mixtral-8x7B-v0.1",
52
53
  },
@@ -85,11 +86,7 @@ class TogetherTask(TaskProviderHelper, ABC):
85
86
  extra_payload: Optional[Dict[str, Any]] = None,
86
87
  ) -> RequestParameters:
87
88
  if api_key is None:
88
- api_key = get_token()
89
- if api_key is None:
90
- raise ValueError(
91
- "You must provide an api_key to work with Together API or log in with `huggingface-cli login`."
92
- )
89
+ raise ValueError("You must provide an api_key to work with Together API.")
93
90
  headers = {**build_hf_headers(token=api_key), **headers}
94
91
 
95
92
  # Route to the proxy if the api_key is a HF TOKEN
@@ -100,8 +97,6 @@ class TogetherTask(TaskProviderHelper, ABC):
100
97
  base_url = BASE_URL
101
98
  logger.info("Calling Together provider directly.")
102
99
  mapped_model = self._map_model(model)
103
- if "model" in parameters:
104
- parameters["model"] = mapped_model
105
100
  payload = self._prepare_payload(inputs, parameters=parameters)
106
101
 
107
102
  return RequestParameters(
@@ -513,7 +513,7 @@ def _format(error_type: Type[HfHubHTTPError], custom_message: str, response: Res
513
513
  server_errors.append(response.text)
514
514
 
515
515
  # Strip all server messages
516
- server_errors = [str(line).strip() for line in server_errors if str(line).strip()]
516
+ server_errors = [line.strip() for line in server_errors if line.strip()]
517
517
 
518
518
  # Deduplicate server messages (keep order)
519
519
  # taken from https://stackoverflow.com/a/17016257
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: huggingface-hub
3
- Version: 0.28.0
3
+ Version: 0.28.0rc0
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=ND2P5L857IGbaFwxYbCpgBLMo0xW0wW5PYaYWHo3MBE,48868
1
+ huggingface_hub/__init__.py,sha256=y-nqilJDYshvFCfitEQXL74C-2KdVxjAHatTP-aFTUk,48872
2
2
  huggingface_hub/_commit_api.py,sha256=TqXmu5moVAhBa7iuyJdsqsfRTxTpGMnvsPkb4GgC3dc,32636
3
3
  huggingface_hub/_commit_scheduler.py,sha256=tfIoO1xWHjTJ6qy6VS6HIoymDycFPg0d6pBSZprrU2U,14679
4
4
  huggingface_hub/_inference_endpoints.py,sha256=PmW6IdIq9SAvlniPuyh3alKfahAmm4cyArQ_vrIcgQE,16992
@@ -15,7 +15,7 @@ huggingface_hub/constants.py,sha256=ha9L6-qMD9IxfHplUkWnXAfyKuNA6fVcVFRXfmYB3L4,
15
15
  huggingface_hub/errors.py,sha256=zble0j94ai8zwyM0a2DovwcF372zQohwDsgajTsaxqI,9703
16
16
  huggingface_hub/fastai_utils.py,sha256=DpeH9d-6ut2k_nCAAwglM51XmRmgfbRe2SPifpVL5Yk,16745
17
17
  huggingface_hub/file_download.py,sha256=h3egIfo07tAC7fbXFfVj1GRCmKn6qTXyMUoSYhu3bSo,70364
18
- huggingface_hub/hf_api.py,sha256=cvGLQroZ1wT1H3s_vKA1Q2TrogCKDQiONkuitVw2TeU,422283
18
+ huggingface_hub/hf_api.py,sha256=DZdBsl69T1OhNGoI_XsaPAicTRGx0V0R1oAe1ivv3XM,422267
19
19
  huggingface_hub/hf_file_system.py,sha256=m_g7uYLGxTdsBnhvR5835jvYMAuEBsUSFvEbzZKzzoo,47500
20
20
  huggingface_hub/hub_mixin.py,sha256=-oTnuB3b-0WeutZ1iBkAy1YuWrBKvHBVBpmd3-7oGB4,37419
21
21
  huggingface_hub/inference_api.py,sha256=b4-NhPSn9b44nYKV8tDKXodmE4JVdEymMWL4CVGkzlE,8323
@@ -78,11 +78,11 @@ huggingface_hub/inference/_generated/types/zero_shot_classification.py,sha256=Xy
78
78
  huggingface_hub/inference/_generated/types/zero_shot_image_classification.py,sha256=sXIYvmrX0DreSfjERDKeY9iTFV8Zg_UEo6m5xsOsInE,1466
79
79
  huggingface_hub/inference/_generated/types/zero_shot_object_detection.py,sha256=LFtdjPxuEMsEcCqqrJETV05t9bz4CpdYMfU2a-eBvl4,1598
80
80
  huggingface_hub/inference/_providers/__init__.py,sha256=3a81s3o50LzYMB1ePy6JU3z3imZ6TUUfnEsunScbwYk,4061
81
- huggingface_hub/inference/_providers/fal_ai.py,sha256=tS2sUzpw08cLKta2vSBablgUI7GiMO8APeJXd6wPo5A,5870
81
+ huggingface_hub/inference/_providers/fal_ai.py,sha256=0DIbmGbPbLfk2VIUbi8UyjBUfkCBKuLUVoxbRsCvkIU,5728
82
82
  huggingface_hub/inference/_providers/hf_inference.py,sha256=lh52LekKRi43VX18tLGi2LE2iOC3dNfdP8GsfqUfTMQ,7210
83
- huggingface_hub/inference/_providers/replicate.py,sha256=hStDlm789VaEjKUVlUFoxvQ9SnczLCeS1wL_NBkWGFs,5682
84
- huggingface_hub/inference/_providers/sambanova.py,sha256=KenHXBitAueQhSd6_ZsRXtCHQNi4s5g0R4BLVa8SC64,3429
85
- huggingface_hub/inference/_providers/together.py,sha256=ZJGcfzZkJ0AVUJX-qiuWIrL2YCMBy-AAmdZaVrmYvDU,6909
83
+ huggingface_hub/inference/_providers/replicate.py,sha256=XDpwMpqVQHO5fY4ISKXFUoeYFAOGqeX_f_KmFkwKseY,5540
84
+ huggingface_hub/inference/_providers/sambanova.py,sha256=NST0mEr_r3O0ZrOvrVpx2l7Xd5Mo7Phun4t2qrKo9j0,3287
85
+ huggingface_hub/inference/_providers/together.py,sha256=Erf0UkvKc3KYWKNaN0chmCoIFRoTw1uu3senwxjYei8,6767
86
86
  huggingface_hub/serialization/__init__.py,sha256=kn-Fa-m4FzMnN8lNsF-SwFcfzug4CucexybGKyvZ8S0,1041
87
87
  huggingface_hub/serialization/_base.py,sha256=Df3GwGR9NzeK_SD75prXLucJAzPiNPgHbgXSw-_LTk8,8126
88
88
  huggingface_hub/serialization/_dduf.py,sha256=s42239rLiHwaJE36QDEmS5GH7DSmQ__BffiHJO5RjIg,15424
@@ -102,7 +102,7 @@ huggingface_hub/utils/_fixes.py,sha256=xQV1QkUn2WpLqLjtXNiyn9gh-454K6AF-Q3kwkYAQ
102
102
  huggingface_hub/utils/_git_credential.py,sha256=SDdsiREr1TcAR2Ze2TB0E5cYzVJgvDZrs60od9lAsMc,4596
103
103
  huggingface_hub/utils/_headers.py,sha256=A-OYkrVG8LQGgeNq79rIbPD0ovHBibnoASoxJESzeuY,8698
104
104
  huggingface_hub/utils/_hf_folder.py,sha256=cffdBqvvk0E_DW9rkaaVXLYOTFsOREDB_Y98evp_nWI,3612
105
- huggingface_hub/utils/_http.py,sha256=L5mw-SXZ_uJvC9hZLB9yy-2u_vqTtVCFNUNN--OdDQU,22700
105
+ huggingface_hub/utils/_http.py,sha256=BOi73AI9VpVZpTdtdT7_k-IaXM2dJumbr_7sP-hqHWI,22690
106
106
  huggingface_hub/utils/_lfs.py,sha256=EC0Oz6Wiwl8foRNkUOzrETXzAWlbgpnpxo5a410ovFY,3957
107
107
  huggingface_hub/utils/_pagination.py,sha256=hzLFLd8i_DKkPRVYzOx2CxLt5lcocEiAxDJriQUjAjY,1841
108
108
  huggingface_hub/utils/_paths.py,sha256=w1ZhFmmD5ykWjp_hAvhjtOoa2ZUcOXJrF4a6O3QpAWo,5042
@@ -117,9 +117,9 @@ huggingface_hub/utils/insecure_hashlib.py,sha256=OjxlvtSQHpbLp9PWSrXBDJ0wHjxCBU-
117
117
  huggingface_hub/utils/logging.py,sha256=rkY4bb4aoXiM9MFtA2jGq9Mjh2rKZ0dYdwFM-x5odWc,4726
118
118
  huggingface_hub/utils/sha.py,sha256=OFnNGCba0sNcT2gUwaVCJnldxlltrHHe0DS_PCpV3C4,2134
119
119
  huggingface_hub/utils/tqdm.py,sha256=ZgdphuTnwAIaUKnnD2P7qVvNHpzHAyrYoItkiV0aEjQ,9835
120
- huggingface_hub-0.28.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
121
- huggingface_hub-0.28.0.dist-info/METADATA,sha256=sWahuDZcXGYzISqBQh7OLtZSe8HQN8p4N3XJxJM3qpM,13480
122
- huggingface_hub-0.28.0.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
123
- huggingface_hub-0.28.0.dist-info/entry_points.txt,sha256=Y3Z2L02rBG7va_iE6RPXolIgwOdwUFONyRN3kXMxZ0g,131
124
- huggingface_hub-0.28.0.dist-info/top_level.txt,sha256=8KzlQJAY4miUvjAssOAJodqKOw3harNzuiwGQ9qLSSk,16
125
- huggingface_hub-0.28.0.dist-info/RECORD,,
120
+ huggingface_hub-0.28.0rc0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
121
+ huggingface_hub-0.28.0rc0.dist-info/METADATA,sha256=CjTOjLb-GYqtywYymFWBem_SJYntYudQVJZr_ZiDa3Q,13483
122
+ huggingface_hub-0.28.0rc0.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
123
+ huggingface_hub-0.28.0rc0.dist-info/entry_points.txt,sha256=Y3Z2L02rBG7va_iE6RPXolIgwOdwUFONyRN3kXMxZ0g,131
124
+ huggingface_hub-0.28.0rc0.dist-info/top_level.txt,sha256=8KzlQJAY4miUvjAssOAJodqKOw3harNzuiwGQ9qLSSk,16
125
+ huggingface_hub-0.28.0rc0.dist-info/RECORD,,