You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api-inference/tasks/chat-completion.md
+7-5Lines changed: 7 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,18 +15,20 @@ For more details, check out:
15
15
## Chat Completion
16
16
17
17
Generate a response given a list of messages in a conversational context, supporting both conversational Language Models (LLMs) and conversational Vision-Language Models (VLMs).
18
-
This is a subtask of [`text-generation`](./text_generation) and [`image-text-to-text`](./image_text_to_text).
18
+
This is a subtask of [`text-generation`](https://huggingface.co/docs/api-inference/tasks/text-generation) and [`image-text-to-text`](https://huggingface.co/docs/api-inference/tasks/image-text-to-text).
19
19
20
20
### Recommended models
21
21
22
22
#### Conversational Large Language Models (LLMs)
23
+
23
24
-[google/gemma-2-2b-it](https://huggingface.co/google/gemma-2-2b-it): A text-generation model trained to follow instructions.
24
25
-[meta-llama/Meta-Llama-3.1-8B-Instruct](https://huggingface.co/meta-llama/Meta-Llama-3.1-8B-Instruct): Very powerful text generation model trained to follow instructions.
25
26
-[microsoft/Phi-3-mini-4k-instruct](https://huggingface.co/microsoft/Phi-3-mini-4k-instruct): Small yet powerful text generation model.
@@ -72,7 +74,7 @@ for message in client.chat_completion(
72
74
print(message.choices[0].delta.content, end="")
73
75
```
74
76
75
-
To use the Python client, see `huggingface_hub`'s [package reference](https://huggingface.co/docs/huggingface_hub/package_reference/inference_client#huggingface_hub.InferenceClient.conversational_text-generation).
77
+
To use the Python client, see `huggingface_hub`'s [package reference](https://huggingface.co/docs/huggingface_hub/package_reference/inference_client#huggingface_hub.InferenceClient.chat_completion).
76
78
</python>
77
79
78
80
<js>
@@ -90,7 +92,7 @@ for await (const chunk of inference.chatCompletionStream({
90
92
}
91
93
```
92
94
93
-
To use the JavaScript client, see `huggingface.js`'s [package reference](https://huggingface.co/docs/huggingface.js/inference/classes/HfInference#conversationaltext-generation).
95
+
To use the JavaScript client, see `huggingface.js`'s [package reference](https://huggingface.co/docs/huggingface.js/inference/classes/HfInference#chatcompletion).
94
96
</js>
95
97
96
98
</inferencesnippet>
@@ -150,7 +152,7 @@ for message in client.chat_completion(
150
152
print(message.choices[0].delta.content, end="")
151
153
```
152
154
153
-
To use the Python client, see `huggingface_hub`'s [package reference](https://huggingface.co/docs/huggingface_hub/package_reference/inference_client#huggingface_hub.InferenceClient.conversational_image-text-to-text).
155
+
To use the Python client, see `huggingface_hub`'s [package reference](https://huggingface.co/docs/huggingface_hub/package_reference/inference_client#huggingface_hub.InferenceClient.chat_completion).
154
156
</python>
155
157
156
158
<js>
@@ -177,7 +179,7 @@ for await (const chunk of inference.chatCompletionStream({
177
179
}
178
180
```
179
181
180
-
To use the JavaScript client, see `huggingface.js`'s [package reference](https://huggingface.co/docs/huggingface.js/inference/classes/HfInference#conversationalimage-text-to-text).
182
+
To use the JavaScript client, see `huggingface.js`'s [package reference](https://huggingface.co/docs/huggingface.js/inference/classes/HfInference#chatcompletion).
Copy file name to clipboardExpand all lines: scripts/api-inference/templates/task/image-text-to-text.handlebars
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,6 @@ Image-text-to-text models take in an image and text prompt and output text. Thes
18
18
19
19
### API specification
20
20
21
-
For the API specification for conversational image-text-to-text models, please refer to the [Chat Completion API documentation](https://huggingface.co/docs/api-inference/tasks/chat-completion#api-specification).
21
+
For the API specification of conversational image-text-to-text models, please refer to the [Chat Completion API documentation](https://huggingface.co/docs/api-inference/tasks/chat-completion#api-specification).
0 commit comments