Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
Baichuan_lmdeploy
Commits
ac61156c
Commit
ac61156c
authored
Aug 28, 2024
by
xuxzh1
🎱
Browse files
update
parent
7a7c3829
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
19 deletions
+10
-19
.gitmodules
.gitmodules
+2
-2
README.md
README.md
+7
-16
lmdeploy
lmdeploy
+1
-1
No files found.
.gitmodules
View file @
ac61156c
[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
README.md
View file @
ac61156c
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment