Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
RunningLeon committed Oct 17, 2023
1 parent f57adcd commit c924213
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 19 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ lmdeploy serve gradio ./workspace
Launch inference server by:

```shell
lmdeploy serve api_server ./workspace server_ip server_port --instance_num 32 --tp 1
lmdeploy serve api_server ./workspace --instance_num 32 --tp 1
```

Then, you can communicate with it by command line,
Expand Down
6 changes: 3 additions & 3 deletions README_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ lmdeploy serve gradio ./workspace
使用下面的命令启动推理服务:

```shell
lmdeploy serve api_server ./workspace server_ip server_port --instance_num 32 --tp 1
lmdeploy serve api_server ./workspace --server_name 0.0.0.0 --server_port ${server_port} --instance_num 32 --tp 1
```

你可以通过命令行方式与推理服务进行对话:
Expand All @@ -164,8 +164,8 @@ lmdeploy serve api_client restful_api_url
```shell
# restful_api_url is what printed in api_server.py, e.g. http://localhost:23333
# server_ip and server_port here are for gradio ui
# example: lmdeploy serve gradio http://localhost:23333 localhost 6006 --restful_api True
lmdeploy serve gradio restful_api_url server_ip --restful_api True
# example: 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 ${port} --restful_api True
```

更多详情可以查阅 [restful_api.md](docs/zh_cn/restful_api.md)
Expand Down
4 changes: 2 additions & 2 deletions docs/en/restful_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
### Launch Service

```shell
lmdeploy serve api_server ./workspace 0.0.0.0 server_port --instance_num 32 --tp 1
lmdeploy serve api_server ./workspace --server_name 0.0.0.0 --server_port 6006 --instance_num 32 --tp 1
```

Then, the user can open the swagger UI: `http://{server_ip}:{server_port}` for the detailed api usage.
Expand Down Expand Up @@ -135,7 +135,7 @@ You can also test restful-api through webui.
```shell
# restful_api_url is what printed in api_server.py, e.g. http://localhost:23333
# server_ip and server_port here are for gradio ui
# example: lmdeploy serve gradio http://localhost:23333 localhost 6006 --restful_api True
# example: lmdeploy serve gradio http://localhost:23333 --server_name localhost --server_port 6006 --restful_api True
lmdeploy serve gradio restful_api_url server_ip --restful_api True
```

Expand Down
6 changes: 3 additions & 3 deletions docs/zh_cn/restful_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
运行脚本

```shell
lmdeploy serve api_server ./workspace 0.0.0.0 server_port --instance_num 32 --tp 1
lmdeploy serve api_server ./workspace 0.0.0.0 --server_port ${server_port} --instance_num 32 --tp 1
```

然后用户可以打开 swagger UI: `http://{server_ip}:{server_port}` 详细查看所有的 API 及其使用方法。
Expand Down Expand Up @@ -137,8 +137,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 localhost 6006 --restful_api True
lmdeploy serve gradio restful_api_url server_ip --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 ${port} --restful_api True
```

### FAQ
Expand Down
6 changes: 3 additions & 3 deletions docs/zh_cn/supported_models/codellama.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ TBD
```shell
# --instance_num: turbomind推理实例的个数。可理解为支持的最大并发数
# --tp: 在 tensor parallel时,使用的GPU数量
lmdeploy serve api_server ./workspace server_ip server_port --instance_num 32 --tp 1
lmdeploy serve api_server ./workspace --server_name 0.0.0.0 --server_port ${server_port} --instance_num 32 --tp 1
```

打开 `http://{server_ip}:{server_port}`,即可访问 swagger,查阅 RESTful API 的详细信息。
Expand All @@ -107,8 +107,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 localhost 6006 --restful_api True
lmdeploy serve gradio restful_api_url server_ip --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 ${port} --restful_api True
```

关于 RESTful API的详细介绍,请参考[这份](../restful_api.md)文档。
5 changes: 0 additions & 5 deletions lmdeploy/__main__.py

This file was deleted.

4 changes: 2 additions & 2 deletions lmdeploy/cli/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class SubCliServe(object):

def gradio(self,
model_path_or_server: str,
server_name: str = 'localhost',
server_name: str = '0.0.0.0',
server_port: int = 6006,
batch_size: int = 32,
tp: int = 1,
Expand Down Expand Up @@ -48,7 +48,7 @@ def gradio(self,

def api_server(self,
model_path: str,
server_name: str = 'localhost',
server_name: str = '0.0.0.0',
server_port: int = 23333,
instance_num: int = 32,
tp: int = 1,
Expand Down

0 comments on commit c924213

Please sign in to comment.