Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove jinja tips + fix typo in chat completion docstring #2368

Merged
merged 2 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions src/huggingface_hub/inference/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,16 +518,6 @@ def chat_completion(
"""
A method for completing conversations using a specified language model.

<Tip>

If the model is served by a server supporting chat-completion, the method will directly call the server's
`/v1/chat/completions` endpoint. If the server does not support chat-completion, the method will render the
chat template client-side based on the information fetched from the Hub API. In this case, you will need to
have `minijinja` template engine installed. Run `pip install "huggingface_hub[inference]"` or `pip install minijinja`
to install it.

</Tip>

Args:
messages (List[Union[`SystemMessage`, `UserMessage`, `AssistantMessage`]]):
Conversation history consisting of roles and content pairs.
Expand Down Expand Up @@ -584,7 +574,7 @@ def chat_completion(
send the request.

Returns:
[`ChatCompletionOutput] or Iterable of [`ChatCompletionStreamOutput`]:
[`ChatCompletionOutput`] or Iterable of [`ChatCompletionStreamOutput`]:
Generated text returned from the server:
- if `stream=False`, the generated text is returned as a [`ChatCompletionOutput`] (default).
- if `stream=True`, the generated text is returned token by token as a sequence of [`ChatCompletionStreamOutput`].
Expand Down
12 changes: 1 addition & 11 deletions src/huggingface_hub/inference/_generated/_async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,16 +519,6 @@ async def chat_completion(
"""
A method for completing conversations using a specified language model.

<Tip>

If the model is served by a server supporting chat-completion, the method will directly call the server's
`/v1/chat/completions` endpoint. If the server does not support chat-completion, the method will render the
chat template client-side based on the information fetched from the Hub API. In this case, you will need to
have `minijinja` template engine installed. Run `pip install "huggingface_hub[inference]"` or `pip install minijinja`
to install it.

</Tip>

Args:
messages (List[Union[`SystemMessage`, `UserMessage`, `AssistantMessage`]]):
Conversation history consisting of roles and content pairs.
Expand Down Expand Up @@ -585,7 +575,7 @@ async def chat_completion(
send the request.

Returns:
[`ChatCompletionOutput] or Iterable of [`ChatCompletionStreamOutput`]:
[`ChatCompletionOutput`] or Iterable of [`ChatCompletionStreamOutput`]:
Generated text returned from the server:
- if `stream=False`, the generated text is returned as a [`ChatCompletionOutput`] (default).
- if `stream=True`, the generated text is returned token by token as a sequence of [`ChatCompletionStreamOutput`].
Expand Down
Loading