huggingface-hub 0.24.2__py3-none-any.whl → 0.24.3__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.24.2"
49
+ __version__ = "0.24.3"
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
@@ -819,13 +819,16 @@ class InferenceClient:
819
819
  # First, resolve the model chat completions URL
820
820
  if model == self.base_url:
821
821
  # base_url passed => add server route
822
- model_url = model + "/v1/chat/completions"
822
+ model_url = model.rstrip("/")
823
+ if not model_url.endswith("/v1"):
824
+ model_url += "/v1"
825
+ model_url += "/chat/completions"
823
826
  elif is_url:
824
827
  # model is a URL => use it directly
825
828
  model_url = model
826
829
  else:
827
830
  # model is a model ID => resolve it + add server route
828
- model_url = self._resolve_url(model) + "/v1/chat/completions"
831
+ model_url = self._resolve_url(model).rstrip("/") + "/v1/chat/completions"
829
832
 
830
833
  # `model` is sent in the payload. Not used by the server but can be useful for debugging/routing.
831
834
  # If it's a ID on the Hub => use it. Otherwise, we use a random string.
@@ -825,13 +825,16 @@ class AsyncInferenceClient:
825
825
  # First, resolve the model chat completions URL
826
826
  if model == self.base_url:
827
827
  # base_url passed => add server route
828
- model_url = model + "/v1/chat/completions"
828
+ model_url = model.rstrip("/")
829
+ if not model_url.endswith("/v1"):
830
+ model_url += "/v1"
831
+ model_url += "/chat/completions"
829
832
  elif is_url:
830
833
  # model is a URL => use it directly
831
834
  model_url = model
832
835
  else:
833
836
  # model is a model ID => resolve it + add server route
834
- model_url = self._resolve_url(model) + "/v1/chat/completions"
837
+ model_url = self._resolve_url(model).rstrip("/") + "/v1/chat/completions"
835
838
 
836
839
  # `model` is sent in the payload. Not used by the server but can be useful for debugging/routing.
837
840
  # If it's a ID on the Hub => use it. Otherwise, we use a random string.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: huggingface-hub
3
- Version: 0.24.2
3
+ Version: 0.24.3
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=SwU8lwrGTWMwmxGEtUdkOpsUf9F_f7mQffM3o9fY_WY,33897
1
+ huggingface_hub/__init__.py,sha256=9WZ38NMx_Rfc7vUU0ij0OaaKaTx7a1EAAxxvETi4WXM,33897
2
2
  huggingface_hub/_commit_api.py,sha256=Yj1ft_WbsnqjSbiYHgdqGmLTF6BTA4E8kAGYW89t2sQ,31057
3
3
  huggingface_hub/_commit_scheduler.py,sha256=nlJS_vnLb8i92NLrRwJX8Mg9QZ7f3kfLbLlQuEd5YjU,13647
4
4
  huggingface_hub/_inference_endpoints.py,sha256=th6vlJ2vUg314x7uMLzQHfy4AuX5mFlJqNobVIz5yOY,15944
@@ -37,12 +37,12 @@ huggingface_hub/commands/tag.py,sha256=gCoR8G95lhHBzyVytTxT7MnqTmjKYtStDnHXcysOJ
37
37
  huggingface_hub/commands/upload.py,sha256=Mr69qO60otqCVw0sVSBPykUTkL9HO-pkCyulSD2mROM,13622
38
38
  huggingface_hub/commands/user.py,sha256=QApZJOCQEHADhjunM3hlQ72uqHsearCiCE4SdpzGdcc,6893
39
39
  huggingface_hub/inference/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
40
- huggingface_hub/inference/_client.py,sha256=6oJjWgDIGqKK52DU7VR2fQkqYqf2UGQbHWMEqVszaZU,129014
40
+ huggingface_hub/inference/_client.py,sha256=xZJIdLXyP4KBz4H4YH1bpaAzCor7NlYIQ6ZvKbnDlqY,129139
41
41
  huggingface_hub/inference/_common.py,sha256=EEF8T9jtfLvqhIwwDM0vt8S54yObExoBncJIiHvEew8,14882
42
42
  huggingface_hub/inference/_templating.py,sha256=LCy-U_25R-l5dhcEHsyRwiOrgvKQHXkdSmynWCfsPjI,3991
43
43
  huggingface_hub/inference/_types.py,sha256=C73l5-RO8P1UMBHF8OAO9CRUq7Xdv33pcADoJsGMPSU,1782
44
44
  huggingface_hub/inference/_generated/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
45
- huggingface_hub/inference/_generated/_async_client.py,sha256=X7dHAHJdDbAvho3_tsyOjH0spC_aJUCNeG_UclHSo_Q,132715
45
+ huggingface_hub/inference/_generated/_async_client.py,sha256=6DsgWd79983rtd9GZsERCZz7qHwhcBApLNuT7QdHq5s,132840
46
46
  huggingface_hub/inference/_generated/types/__init__.py,sha256=uEsA0z8Gcu34q0gNAZVcqHFqJT5BPrhnM9qS_LQgN0Q,5215
47
47
  huggingface_hub/inference/_generated/types/audio_classification.py,sha256=wk4kUTLQZoXWLpiUOpKRHRRE-JYqqJlzGVe62VACR-0,1347
48
48
  huggingface_hub/inference/_generated/types/audio_to_audio.py,sha256=n7GeCepzt254yoSLsdjrI1j4fzYgjWzxoaKE5gZJc48,881
@@ -107,9 +107,9 @@ huggingface_hub/utils/insecure_hashlib.py,sha256=OjxlvtSQHpbLp9PWSrXBDJ0wHjxCBU-
107
107
  huggingface_hub/utils/logging.py,sha256=Cp03s0uEl3kDM9XHQW9a8GAoExODQ-e7kEtgMt-_To8,4728
108
108
  huggingface_hub/utils/sha.py,sha256=OFnNGCba0sNcT2gUwaVCJnldxlltrHHe0DS_PCpV3C4,2134
109
109
  huggingface_hub/utils/tqdm.py,sha256=jQiVYwRG78HK4_54u0vTtz6Kt9IMGiHy3ixbIn3h2TU,9368
110
- huggingface_hub-0.24.2.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
111
- huggingface_hub-0.24.2.dist-info/METADATA,sha256=v6G7PRFjD854k5FqvZSixwtHyQq2bMb5wNvWcfwMRqk,13183
112
- huggingface_hub-0.24.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
113
- huggingface_hub-0.24.2.dist-info/entry_points.txt,sha256=Y3Z2L02rBG7va_iE6RPXolIgwOdwUFONyRN3kXMxZ0g,131
114
- huggingface_hub-0.24.2.dist-info/top_level.txt,sha256=8KzlQJAY4miUvjAssOAJodqKOw3harNzuiwGQ9qLSSk,16
115
- huggingface_hub-0.24.2.dist-info/RECORD,,
110
+ huggingface_hub-0.24.3.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
111
+ huggingface_hub-0.24.3.dist-info/METADATA,sha256=cHfR-kRxVtLKL3cwiEe0NLhQxRdr2JkFgb89DINcNN4,13183
112
+ huggingface_hub-0.24.3.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
113
+ huggingface_hub-0.24.3.dist-info/entry_points.txt,sha256=Y3Z2L02rBG7va_iE6RPXolIgwOdwUFONyRN3kXMxZ0g,131
114
+ huggingface_hub-0.24.3.dist-info/top_level.txt,sha256=8KzlQJAY4miUvjAssOAJodqKOw3harNzuiwGQ9qLSSk,16
115
+ huggingface_hub-0.24.3.dist-info/RECORD,,