Update README.md
Browse files
README.md
CHANGED
|
@@ -196,7 +196,7 @@ lmdeploy serve api_server ./workspace \
|
|
| 196 |
--tp 1
|
| 197 |
```
|
| 198 |
|
| 199 |
-
In the above parameters, `server_name` and `server_port` indicate the service address and port, respectively. The `tp` parameter, as mentioned earlier, stands for Tensor Parallelism.
|
| 200 |
|
| 201 |
After this, users can start the Web Service as described in [TurboMind Service as the Backend](#--turbomind-service-as-the-backend).
|
| 202 |
|
|
@@ -382,6 +382,51 @@ curl http://localhost:8000/v1/chat/completions \
|
|
| 382 |
|
| 383 |
更多信息请查看 [vLLM 文档](https://docs.vllm.ai/en/latest/index.html)
|
| 384 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 385 |
|
| 386 |
## 网页服务启动方式1:
|
| 387 |
|
|
|
|
| 196 |
--tp 1
|
| 197 |
```
|
| 198 |
|
| 199 |
+
In the above parameters, `server_name` and `server_port` indicate the service address and port, respectively. The `tp` parameter, as mentioned earlier, stands for Tensor Parallelism.
|
| 200 |
|
| 201 |
After this, users can start the Web Service as described in [TurboMind Service as the Backend](#--turbomind-service-as-the-backend).
|
| 202 |
|
|
|
|
| 382 |
|
| 383 |
更多信息请查看 [vLLM 文档](https://docs.vllm.ai/en/latest/index.html)
|
| 384 |
|
| 385 |
+
## 使用本地训练模型
|
| 386 |
+
|
| 387 |
+
### 第一步:转换为 lmdeploy TurboMind 格式
|
| 388 |
+
|
| 389 |
+
这里,我们将使用预训练的模型文件,并在用户的根目录下执行转换,如下所示。
|
| 390 |
+
|
| 391 |
+
```bash
|
| 392 |
+
# 将模型转换为 TurboMind (FastTransformer 格式)
|
| 393 |
+
lmdeploy convert internlm2-chat-7b /root/autodl-tmp/agri_intern/XiXiLM --tokenizer-path ./GouMang/tokenizer.json
|
| 394 |
+
```
|
| 395 |
+
|
| 396 |
+
执行完毕后,当前目录下将生成一个 workspace 文件夹。
|
| 397 |
+
这个文件夹包含 TurboMind 和 Triton “模型推理”所需的文件,如下所示:
|
| 398 |
+
|
| 399 |
+
|
| 400 |
+

|
| 401 |
+
|
| 402 |
+
|
| 403 |
+
### 第二步:本地聊天
|
| 404 |
+
|
| 405 |
+
```bash
|
| 406 |
+
lmdeploy chat turbomind ./workspace
|
| 407 |
+
```
|
| 408 |
+
|
| 409 |
+
### 第三步(可选):TurboMind 推理 + API 服务
|
| 410 |
+
|
| 411 |
+
在前一部分中,我们尝试通过命令行直接启动客户端。现在,我们将尝试使用 lmdeploy 进行服务部署。
|
| 412 |
+
|
| 413 |
+
“模型推理/服务”目前提供两种服务部署方式:TurboMind 和 TritonServer。在这种情况下,服务器可以是 TurboMind 或 TritonServer,而 API 服务器可以提供外部 API 服务。我们推荐使用 TurboMind。
|
| 414 |
+
|
| 415 |
+
首先,使用以下命令启动服务:
|
| 416 |
+
|
| 417 |
+
```bash
|
| 418 |
+
# ApiServer+Turbomind api_server => AsyncEngine => TurboMind
|
| 419 |
+
lmdeploy serve api_server ./workspace \
|
| 420 |
+
--server-name 0.0.0.0 \
|
| 421 |
+
--server-port 23333 \
|
| 422 |
+
--tp 1
|
| 423 |
+
```
|
| 424 |
+
|
| 425 |
+
在上述参数中,server_name 和 server_port 分别表示服务地址和端口。tp 参数如前所述代表 Tensor 并行性。
|
| 426 |
+
|
| 427 |
+
之后,用户可以按照[TurboMind Service as the Backend](#--turbomind-service-as-the-backend) 中描述的启动 Web 服务。
|
| 428 |
+
|
| 429 |
+
|
| 430 |
|
| 431 |
## 网页服务启动方式1:
|
| 432 |
|