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
442f91a1
Commit
442f91a1
authored
Aug 31, 2024
by
shantf
Browse files
update README.md
parent
ca74ba49
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
28 deletions
+13
-28
README.md
README.md
+13
-28
No files found.
README.md
View file @
442f91a1
...
@@ -25,27 +25,16 @@ Baichuan整体模型基于标准的Transformer结构,采用了和LLaMA一样
...
@@ -25,27 +25,16 @@ Baichuan整体模型基于标准的Transformer结构,采用了和LLaMA一样
提供光源拉取推理的docker镜像:
提供光源拉取推理的docker镜像:
```
bash
```
bash
docker pull image.sourcefind.cn:5000/dcu/admin/base/pytorch:2.1.0-ubuntu20.04-dtk24.04.1-py3.10
(
推荐
)
docker pull image.sourcefind.cn:5000/dcu/admin/base/pytorch:2.1.0-ubuntu20.04-dtk24.04.1-py3.10
(
推荐
)
docker pull image.sourcefind.cn:5000/dcu/admin/base/custom:lmdeploy0.0.13_dtk23.04_torch1.13_py38
# <Image ID>用上面拉取docker镜像的ID替换
# <Image ID>用上面拉取docker镜像的ID替换
# <Host Path>主机端路径
# <Host Path>主机端路径
# <Container Path>容器映射路径
# <Container Path>容器映射路径
docker run
-it
--name
baichuan
--shm-size
=
1024G
--device
=
/dev/kfd
--device
=
/dev/dri/
--cap-add
=
SYS_PTRACE
--security-opt
seccomp
=
unconfined
--ulimit
memlock
=
-1
:-1
--ipc
=
host
--network
host
--group-add
video
-v
<Host Path>:<Container Path> <Image ID> /bin/bash
docker run
-it
--name
baichuan
--shm-size
=
1024G
--device
=
/dev/kfd
--device
=
/dev/dri/
--cap-add
=
SYS_PTRACE
--security-opt
seccomp
=
unconfined
-v
/opt/hyhal:/opt/hyhal:ro
--ulimit
memlock
=
-1
:-1
--ipc
=
host
--network
host
--group-add
video
-v
<Host Path>:<Container Path> <Image ID> /bin/bash
```
```
镜像版本依赖:
镜像版本依赖:
*
DTK驱动:24.04.1
*
DTK驱动:24.04.1
*
Pytorch: 2.1.0
*
Pytorch: 2.1.0
*
python: python3.10
*
python: python3.10
> [!NOTE]
>
> 使用lmdeploy0.0.13_dtk23.04_torch1.13_py38如果遇到 importError:libgemm multiB int4.so: cannot open shared obiect file: No such file or directory
>
> 解决方法:
>
> ```bash
> rm /usr/local/lib/python3.8/site-packages/_turbomind.cpython-38-x86_64-linux-gnu.so
> ```
## 数据集
## 数据集
...
@@ -67,7 +56,15 @@ make install
...
@@ -67,7 +56,15 @@ make install
cd
..
&&
python3 setup.py
install
cd
..
&&
python3 setup.py
install
```
```
### 模型下载
### 模型下载
预训练权重快速下载中心:
[
SCNet AIModels
](
http://113.200.138.88:18080/aimodels
)
项目中的预训练权重快速通道下载地址:
http://113.200.138.88:18080/aimodels/Baichuan-7B
http://113.200.138.88:18080/aimodels/Baichuan2-7B-Chat
官方下载地址:
[
baichuan-7b
](
https://huggingface.co/baichuan-inc/Baichuan-7B
)
[
baichuan-7b
](
https://huggingface.co/baichuan-inc/Baichuan-7B
)
[
baichuan2-7b-chat
](
https://huggingface.co/baichuan-inc/Baichuan2-7B-Chat
)
[
baichuan2-7b-chat
](
https://huggingface.co/baichuan-inc/Baichuan2-7B-Chat
)
...
@@ -85,24 +82,16 @@ source /opt/dtk/cuda/env.sh
...
@@ -85,24 +82,16 @@ source /opt/dtk/cuda/env.sh
### 运行 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')
# <tokenizer_path> tokenizer模型的路径(默认None,会去model_path里面找tokenizer.model)
# <tp> 用于张量并行的GPU数量应该是2^n
# <tp> 用于张量并行的GPU数量应该是2^n
# bash界面运行
# bash界面运行
lmdeploy chat turbomind ./
workspace
_baichuan7b
--tp
1
# 输入问题后执行2次回车进行推理
lmdeploy chat turbomind ./
path_to
_baichuan7b
--tp
1
# 输入问题后执行2次回车进行推理
# 服务器网页端运行
# 服务器网页端运行
在bash端运行:
在bash端运行:
# <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)
# <tp> 用于张量并行的GPU数量应该是2^n (和模型转换的时候保持一致)
# <tp> 用于张量并行的GPU数量应该是2^n (和模型转换的时候保持一致)
# <restful_api> modelpath_or_server的标志(默认是False)
lmdeploy serve gradio ./path_to_baichuan7b
--server-name
{
ip
}
--server-port
{
port
}
--tp
1
lmdeploy serve gradio ./workspace_baichuan7b
--server-name
{
ip
}
--server-port
{
port
}
--batch_size
32
--tp
1
--restful_api
False
在网页上输入
{
ip
}
:
{
port
}
即可进行对话
在网页上输入
{
ip
}
:
{
port
}
即可进行对话
```
```
...
@@ -110,12 +99,12 @@ lmdeploy serve gradio ./workspace_baichuan7b --server-name {ip} --server-port {
...
@@ -110,12 +99,12 @@ lmdeploy serve gradio ./workspace_baichuan7b --server-name {ip} --server-port {
### 运行 baichuan2-7b
### 运行 baichuan2-7b
```
bash
```
bash
# bash界面运行
# bash界面运行
lmdeploy chat turbomind ./
workspace
_baichuan2-7b
--tp
1
lmdeploy chat turbomind ./
path_to
_baichuan2-7b
--tp
1
# 服务器网页端运行
# 服务器网页端运行
在bash端运行:
在bash端运行:
lmdeploy serve gradio ./
workspace
_baichuan2-7b
--server-name
{
ip
}
--server-port
{
port
}
--
batch_size
32
--tp
1
--restful_api
False
lmdeploy serve gradio ./
path_to
_baichuan2-7b
--server-name
{
ip
}
--server-port
{
port
}
--
tp
1
在网页上输入
{
ip
}
:
{
port
}
即可进行对话
在网页上输入
{
ip
}
:
{
port
}
即可进行对话
```
```
...
@@ -138,10 +127,6 @@ lmdeploy serve gradio ./workspace_baichuan2-7b --server-name {ip} --server-port
...
@@ -138,10 +127,6 @@ lmdeploy serve gradio ./workspace_baichuan2-7b --server-name {ip} --server-port
`医疗,教育,科研,金融`
`医疗,教育,科研,金融`
## 预训练权重
预训练权重快速下载中心:
[
SCNet AIModels
](
http://113.200.138.88:18080/aimodels
)
,项目中的预训练权重可从快速下载通道下载:
[
Baichuan-7B
](
http://113.200.138.88:18080/aimodels/Baichuan-7B
)
、
[
Baichuan2-7B-Chat
](
http://113.200.138.88:18080/aimodels/Baichuan2-7B-Chat
)
。
## 源码仓库及问题反馈
## 源码仓库及问题反馈
https://developer.hpccube.com/codes/modelzoo/baichuan_lmdeploy
https://developer.hpccube.com/codes/modelzoo/baichuan_lmdeploy
...
...
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