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

update

parent 7a7c3829
[submodule "lmdeploy"] [submodule "lmdeploy"]
path = lmdeploy path = lmdeploy
url = http://developer.hpccube.com/codes/aicomponent/lmdeploy.git url = https://developer.hpccube.com/codes/OpenDAS/lmdeploy
tag = dtk23.04-v0.0.13 branch = dtk24.04-v0.2.6
\ No newline at end of file
...@@ -56,7 +56,7 @@ docker run -it --name baichuan --shm-size=1024G --device=/dev/kfd --device=/dev ...@@ -56,7 +56,7 @@ docker run -it --name baichuan --shm-size=1024G --device=/dev/kfd --device=/dev
### 源码编译安装 ### 源码编译安装
```bash ```bash
# 若使用光源的镜像,可以跳过源码编译安装,镜像里面安装好了lmdeploy。 # 若使用光源的镜像,可以跳过源码编译安装,镜像里面安装好了lmdeploy。
git clone http://developer.hpccube.com/codes/modelzoo/llama_lmdeploy.git git clone http://developer.hpccube.com/codes/modelzoo/baichuan_lmdeploy.git
cd llama_lmdeploy cd llama_lmdeploy
git submodule init && git submodule update git submodule init && git submodule update
cd lmdeploy cd lmdeploy
...@@ -75,46 +75,37 @@ cd .. && python3 setup.py install ...@@ -75,46 +75,37 @@ cd .. && python3 setup.py install
### 运行 baichuan-7b-chat ### 运行 baichuan-7b-chat
```bash ```bash
# 模型转换
# <model_name> 模型的名字 ('llama', 'internlm', 'vicuna', 'internlm-chat-7b', 'internlm-chat', 'internlm-chat-7b-8k', 'internlm-chat-20b', 'internlm-20b', 'baichuan-7b', 'baichuan2-7b', 'llama2', 'qwen-7b', 'qwen-14b') # <model_name> 模型的名字 ('llama', 'internlm', 'vicuna', 'internlm-chat-7b', 'internlm-chat', 'internlm-chat-7b-8k', 'internlm-chat-20b', 'internlm-20b', 'baichuan-7b', 'baichuan2-7b', 'llama2', 'qwen-7b', 'qwen-14b')
# <model_path> 模型路径
# <model_format> 模型的格式 ('llama', 'hf', 'qwen')
# <tokenizer_path> tokenizer模型的路径(默认None,会去model_path里面找tokenizer.model) # <tokenizer_path> tokenizer模型的路径(默认None,会去model_path里面找tokenizer.model)
# <model_format> 保存输出的目标路径(默认./workspace)
# <tp> 用于张量并行的GPU数量应该是2^n # <tp> 用于张量并行的GPU数量应该是2^n
lmdeploy convert --model_name baichuan-7b --model_path /path/to/model --model_format hf --tokenizer_path None --dst_path ./workspace_baichuan7b --tp 1
# bash界面运行 # bash界面运行
lmdeploy chat turbomind --model_path ./workspace_baichuan7b --tp 1 # 输入问题后执行2次回车进行推理 lmdeploy chat turbomind ./workspace_baichuan7b --tp 1 # 输入问题后执行2次回车进行推理
# 服务器网页端运行 # 服务器网页端运行
在bash端运行: 在bash端运行:
# <model_path_or_server> 部署模型的路径或tritonserver URL或restful api URL。前者用于与gradio直接运行服务。后者用于默认情况下使用tritonserver运行。如果输入URL是restful api。请启用另一个标志“restful_api”。 # <model_path_or_server> 部署模型的路径或tritonserver URL或restful api URL。前者用于与gradio直接运行服务。后者用于默认情况下使用tritonserver运行。如果输入URL是restful api。请启用另一个标志“restful_api”。
# <server_name> gradio服务器的ip地址 # <server-name> gradio服务器的ip地址
# <server_port> gradio服务器的ip的端口 # <server-port> gradio服务器的ip的端口
# <batch_size> 于直接运行Turbomind的batch大小 (默认32) # <batch_size> 于直接运行Turbomind的batch大小 (默认32)
# <tp> 用于张量并行的GPU数量应该是2^n (和模型转换的时候保持一致) # <tp> 用于张量并行的GPU数量应该是2^n (和模型转换的时候保持一致)
# <restful_api> modelpath_or_server的标志(默认是False) # <restful_api> modelpath_or_server的标志(默认是False)
lmdeploy serve gradio --model_path_or_server ./workspace_baichuan7b --server_name {ip} --server_port {port} --batch_size 32 --tp 1 --restful_api False lmdeploy serve gradio ./workspace_baichuan7b --server-name {ip} --server-port {port} --batch_size 32 --tp 1 --restful_api False
在网页上输入{ip}:{port}即可进行对话 在网页上输入{ip}:{port}即可进行对话
``` ```
### 运行 baichuan2-7b ### 运行 baichuan2-7b
```bash ```bash
# 模型转换
lmdeploy convert --model_name baichuan2-7b --model_path /path/to/model --model_format hf --tokenizer_path None --dst_path ./workspace_baichuan2-7b --tp 1
# bash界面运行 # bash界面运行
lmdeploy chat turbomind --model_path ./workspace_baichuan2-7b --tp 1 lmdeploy chat turbomind ./workspace_baichuan2-7b --tp 1
# 服务器网页端运行 # 服务器网页端运行
在bash端运行: 在bash端运行:
lmdeploy serve gradio --model_path_or_server ./workspace_baichuan2-7b --server_name {ip} --server_port {port} --batch_size 32 --tp 1 --restful_api False lmdeploy serve gradio ./workspace_baichuan2-7b --server-name {ip} --server-port {port} --batch_size 32 --tp 1 --restful_api False
在网页上输入{ip}:{port}即可进行对话 在网页上输入{ip}:{port}即可进行对话
``` ```
......
lmdeploy @ 858087a6
Subproject commit e432dbb0e56caaf319b9c9d7b79eb8106852dc91 Subproject commit 858087a625c1dc431ab8b174331dfc95210f6e3a
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