mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-03 12:50:06 +06:00
Merge b83adbbf21
into 548794b886
This commit is contained in:
commit
8f2aebb839
@ -133,8 +133,9 @@ pipeline("the secret to baking a really good cake is ")
|
|||||||
To chat with a model, the usage pattern is the same. The only difference is you need to construct a chat history (the input to `Pipeline`) between you and the system.
|
To chat with a model, the usage pattern is the same. The only difference is you need to construct a chat history (the input to `Pipeline`) between you and the system.
|
||||||
|
|
||||||
> [!TIP]
|
> [!TIP]
|
||||||
> You can also chat with a model directly from the command line.
|
> You can also chat with a model directly from the command line. Please make sure you have the `chat` extra installed:
|
||||||
> ```shell
|
> ```shell
|
||||||
|
> pip install .[chat] # or pip install transformers[chat]
|
||||||
> transformers chat Qwen/Qwen2.5-0.5B-Instruct
|
> transformers chat Qwen/Qwen2.5-0.5B-Instruct
|
||||||
> ```
|
> ```
|
||||||
|
|
||||||
|
@ -31,6 +31,13 @@ This guide shows you how to quickly start chatting with Transformers from the co
|
|||||||
### Interactive chat session
|
### Interactive chat session
|
||||||
|
|
||||||
After you've [installed Transformers](./installation.md), chat with a model directly from the command line as shown below. It launches an interactive session with a model, with a few base commands listed at the start of the session.
|
After you've [installed Transformers](./installation.md), chat with a model directly from the command line as shown below. It launches an interactive session with a model, with a few base commands listed at the start of the session.
|
||||||
|
For this to work, you need to have installed the chat extra:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pip install transformers[chat]
|
||||||
|
```
|
||||||
|
|
||||||
|
You can then launch an interactive session as follows:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
transformers chat Qwen/Qwen2.5-0.5B-Instruct
|
transformers chat Qwen/Qwen2.5-0.5B-Instruct
|
||||||
|
1
setup.py
1
setup.py
@ -314,6 +314,7 @@ extras["hub-kernels"] = deps_list("kernels")
|
|||||||
extras["integrations"] = extras["hub-kernels"] + extras["optuna"] + extras["ray"] + extras["sigopt"]
|
extras["integrations"] = extras["hub-kernels"] + extras["optuna"] + extras["ray"] + extras["sigopt"]
|
||||||
|
|
||||||
extras["serving"] = deps_list("pydantic", "uvicorn", "fastapi", "starlette")
|
extras["serving"] = deps_list("pydantic", "uvicorn", "fastapi", "starlette")
|
||||||
|
extras["chat"] = deps_list("aiohttp", "rich")
|
||||||
extras["audio"] = deps_list(
|
extras["audio"] = deps_list(
|
||||||
"librosa",
|
"librosa",
|
||||||
"pyctcdecode",
|
"pyctcdecode",
|
||||||
|
Loading…
Reference in New Issue
Block a user