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
Yi_lmdeploy
Commits
b12ed3f9
"vscode:/vscode.git/clone" did not exist on "09c8e8d9dfec995e5b1210554ad37062ca2a4f32"
Commit
b12ed3f9
authored
Aug 28, 2024
by
xuxzh1
🎱
Browse files
update
parent
fd488816
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
15 deletions
+5
-15
README.md
README.md
+5
-15
No files found.
README.md
View file @
b12ed3f9
...
@@ -82,24 +82,14 @@ cd .. && pip uninstall lmdeploy && python3 setup.py install
...
@@ -82,24 +82,14 @@ cd .. && pip uninstall lmdeploy && python3 setup.py install
[
Yi-34B-Chat
](
https://huggingface.co/01-ai/Yi-34B-Chat
)
[
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
```
shell
lmdeploy chat turbomind
--model_path
./workspace
_yi-34b
--tp
4
lmdeploy chat turbomind
./path_to
_yi-34b
--tp
4
```
```
#### web页面方式交互
#### web页面方式交互
```
shell
```
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}`
,即可进行对话
浏览器上打开
`http://{server_ip}:{server_port}`
,即可进行对话
**需要保证'{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
...
@@ -109,7 +99,7 @@ lmdeploy serve gradio --model_path_or_server ./workspace_yi-34b --server_name {s
```
shell
```
shell
# --instance_num: turbomind推理实例的个数。可理解为支持的最大并发数
# --instance_num: turbomind推理实例的个数。可理解为支持的最大并发数
# --tp: 在 tensor parallel时,使用的GPU数量
# --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 的详细信息。
浏览器上打开
`http://{server_ip}:{server_port}`
,即可访问 swagger,查阅 RESTful API 的详细信息。
...
@@ -122,8 +112,8 @@ lmdeploy serve api_client restful_api_url
...
@@ -122,8 +112,8 @@ lmdeploy serve api_client restful_api_url
```
shell
```
shell
# restful_api_url 就是 api_server 产生的,比如 http://localhost:23333
# restful_api_url 就是 api_server 产生的,比如 http://localhost:23333
# server_ip 和 server_port 是用来提供 gradio ui 访问服务的
# server_ip 和 server_port 是用来提供 gradio ui 访问服务的
# 例子: lmdeploy serve gradio http://localhost:23333 --server
_
name localhost --server
_
port 6006 --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
lmdeploy serve gradio restful_api_url
--server
-
name
{
server_ip
}
--server
-
port
{
server_port
}
--restful_api
True
```
```
**需要保证'{server_ip}:{server_port}'在外部浏览器中的可访问性**
**需要保证'{server_ip}:{server_port}'在外部浏览器中的可访问性**
...
...
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