Skip to content

Commit

Permalink
Merge branch 'main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
Wauplin authored Aug 12, 2024
2 parents c4b59c4 + 9a9b8c1 commit ad63d89
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/source/en/guides/search.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,5 @@ the following example fetches the top 5 most downloaded datasets on the Hub:



To explore available filter on the Hub, visit [models](https://huggingface.co/models) and [datasets](https://huggingface.co/datasets) pages
To explore available filters on the Hub, visit [models](https://huggingface.co/models) and [datasets](https://huggingface.co/datasets) pages
in your browser, search for some parameters and look at the values in the URL.
4 changes: 2 additions & 2 deletions src/huggingface_hub/file_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def are_symlinks_supported(cache_dir: Union[str, Path, None] = None) -> bool:
message += (
"\nTo support symlinks on Windows, you either need to"
" activate Developer Mode or to run Python as an"
" administrator. In order to see activate developer mode,"
" administrator. In order to activate developer mode,"
" see this article:"
" https://docs.microsoft.com/en-us/windows/apps/get-started/enable-your-device-for-development"
)
Expand Down Expand Up @@ -1736,7 +1736,7 @@ def _get_metadata_or_catch_error(
),
)

url = url = hf_hub_url(repo_id, filename, repo_type=repo_type, revision=revision, endpoint=endpoint)
url = hf_hub_url(repo_id, filename, repo_type=repo_type, revision=revision, endpoint=endpoint)
url_to_download: str = url
etag: Optional[str] = None
commit_hash: Optional[str] = None
Expand Down
7 changes: 5 additions & 2 deletions src/huggingface_hub/inference/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ class InferenceClient:
or a URL to a deployed Inference Endpoint. Defaults to None, in which case a recommended model is
automatically selected for the task.
Note: for better compatibility with OpenAI's client, `model` has been aliased as `base_url`. Those 2
arguments are mutually exclusive and have the exact same behavior.
arguments are mutually exclusive. If using `base_url` for chat completion, the `/chat/completions` suffix
path will be appended to the base URL (see the [TGI Messages API](https://huggingface.co/docs/text-generation-inference/en/messages_api)
documentation for details). When passing a URL as `model`, the client will not append any suffix path to it.
token (`str` or `bool`, *optional*):
Hugging Face token. Will default to the locally saved token if not provided.
Pass `token=False` if you don't want to send your token to the server.
Expand Down Expand Up @@ -172,7 +174,8 @@ def __init__(
raise ValueError(
"Received both `model` and `base_url` arguments. Please provide only one of them."
" `base_url` is an alias for `model` to make the API compatible with OpenAI's client."
" It has the exact same behavior as `model`."
" If using `base_url` for chat completion, the `/chat/completions` suffix path will be appended to the base url."
" When passing a URL as `model`, the client will not append any suffix path to it."
)
if token is not None and api_key is not None:
raise ValueError(
Expand Down
7 changes: 5 additions & 2 deletions src/huggingface_hub/inference/_generated/_async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ class AsyncInferenceClient:
or a URL to a deployed Inference Endpoint. Defaults to None, in which case a recommended model is
automatically selected for the task.
Note: for better compatibility with OpenAI's client, `model` has been aliased as `base_url`. Those 2
arguments are mutually exclusive and have the exact same behavior.
arguments are mutually exclusive. If using `base_url` for chat completion, the `/chat/completions` suffix
path will be appended to the base URL (see the [TGI Messages API](https://huggingface.co/docs/text-generation-inference/en/messages_api)
documentation for details). When passing a URL as `model`, the client will not append any suffix path to it.
token (`str` or `bool`, *optional*):
Hugging Face token. Will default to the locally saved token if not provided.
Pass `token=False` if you don't want to send your token to the server.
Expand Down Expand Up @@ -157,7 +159,8 @@ def __init__(
raise ValueError(
"Received both `model` and `base_url` arguments. Please provide only one of them."
" `base_url` is an alias for `model` to make the API compatible with OpenAI's client."
" It has the exact same behavior as `model`."
" If using `base_url` for chat completion, the `/chat/completions` suffix path will be appended to the base url."
" When passing a URL as `model`, the client will not append any suffix path to it."
)
if token is not None and api_key is not None:
raise ValueError(
Expand Down

0 comments on commit ad63d89

Please sign in to comment.