Commit b12ed3f9 authored by xuxzh1's avatar xuxzh1 🎱
Browse files

update

parent fd488816
......@@ -82,24 +82,14 @@ cd .. && pip uninstall lmdeploy && python3 setup.py install
[Yi-34B-Chat](https://huggingface.co/01-ai/Yi-34B-Chat)
### 运行
#### 模型转换
执行如下的命令,把模型权重转成 turbomind 要求的格式:
```shell
# 转模型格式,转换后的模型会生成在./workspace目录中
# 其中--tp设置为你需要使用的gpu数,tp需要设置为2^n,如果tp设置的不是1,则后续模型的运行命令中也需要带上这个参数与模型对应
lmdeploy convert yi /path/of/yi-34b/model --dst_path ./workspace_yi-34b --tp 4
```
#### bash界面运行
```shell
lmdeploy chat turbomind --model_path ./workspace_yi-34b --tp 4
lmdeploy chat turbomind ./path_to_yi-34b --tp 4
```
#### web页面方式交互
```shell
lmdeploy serve gradio --model_path_or_server ./workspace_yi-34b --server_name {server_ip} --server_port {port} --batch_size 32 --tp 4 --restful_api False
lmdeploy serve gradio ./path_to_yi-34b --server-name {server_ip} --server-port {port} --batch_size 32 --tp 4 --restful_api False
```
浏览器上打开 `http://{server_ip}:{server_port}`,即可进行对话
**需要保证'{server_ip}:{server_port}'在外部浏览器中的可访问性**
......@@ -109,7 +99,7 @@ lmdeploy serve gradio --model_path_or_server ./workspace_yi-34b --server_name {s
```shell
# --instance_num: turbomind推理实例的个数。可理解为支持的最大并发数
# --tp: 在 tensor parallel时,使用的GPU数量
lmdeploy serve api_server ./workspace_yi-34b --server_name ${server_ip} --server_port ${server_port} --instance_num 32 --tp 4
lmdeploy serve api_server ./path_to_yi-34b --server-name {server_ip} --server-port {server_port} --instance_num 32 --tp 4
```
浏览器上打开 `http://{server_ip}:{server_port}`,即可访问 swagger,查阅 RESTful API 的详细信息。
......@@ -122,8 +112,8 @@ lmdeploy serve api_client restful_api_url
```shell
# restful_api_url 就是 api_server 产生的,比如 http://localhost:23333
# server_ip 和 server_port 是用来提供 gradio ui 访问服务的
# 例子: lmdeploy serve gradio http://localhost:23333 --server_name localhost --server_port 6006 --restful_api True
lmdeploy serve gradio restful_api_url --server_name ${server_ip} --server_port ${server_port} --restful_api True
# 例子: lmdeploy serve gradio http://localhost:23333 --server-name localhost --server-port 6006 --restful_api True
lmdeploy serve gradio restful_api_url --server-name {server_ip} --server-port {server_port} --restful_api True
```
**需要保证'{server_ip}:{server_port}'在外部浏览器中的可访问性**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment