Skip to content

Commit e8401f6

Browse files
committed
update readme
1 parent 654ef94 commit e8401f6

File tree

2 files changed

+29
-5
lines changed

2 files changed

+29
-5
lines changed

README.md

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,27 @@ vim config.yaml
112112
```
113113

114114
```yaml
115-
serve_args:
115+
serve_args: # openai 服务的 host 和 pot
116116
host: 0.0.0.0
117117
port: 8082
118+
controller_address: http://localhost:21001 # 控制器的ip地址
119+
# api_keys: 111,222 # 用来设置 openai 密钥
120+
121+
# controller
122+
controller_args: # 控制器的配置参数
123+
host: 0.0.0.0
124+
port: 21001
125+
dispatch_method: shortest_queue # lottery、shortest_queue # 现有两种请求分发策略,随机(lottery) 和 最短队列(shortest_queue),最短队列方法更推荐。
126+
127+
# model worker
128+
model_worker_args: # 模型的配置参数,这里port 不能设置,程序自动分配,并注册到 控制器中。
129+
host: 0.0.0.0
130+
controller_address: http://localhost:21001 # 将模型注册到 控制器的 地址
118131

119132
models:
120133
- chatglm4: #自定义的模型名称
121134
alias: null # 别名 例如 gpt4,gpt3
122-
enable: true # false true
135+
enable: true # false true 控制是否启动模型worker
123136
model_name_or_path: /home/dev/model/THUDM/glm-4-9b-chat/
124137
model_type: chatglm # qwen chatglm3 yi internlm
125138
work_mode: vllm # vllm hf lmdeploy-turbomind lmdeploy-pytorch
@@ -130,10 +143,20 @@ models:
130143
- gpus:
131144
# - 1
132145
- 0
133-
146+
147+
# - gpus: 表示 模型使用 gpu[0,1],默认使用的 TP(张量并行)
148+
# - 0
149+
# - 1
150+
151+
# - gpus: 表示启动两个模型,模型副本1加载到 0卡, 模型副本2 加载到 1卡
152+
# - 0
153+
# - gpus:
154+
# - 1
155+
156+
134157
- qwen: #自定义的模型名称
135158
alias: gpt-4,gpt-3.5-turbo,gpt-3.5-turbo-16k # 别名 例如 gpt4,gpt3
136-
enable: true # false true
159+
enable: true # false true 控制是否启动模型worker
137160
model_name_or_path: /home/dev/model/qwen/Qwen1___5-14B-Chat/
138161
model_type: qwen # qwen chatglm3 yi internlm
139162
work_mode: vllm # vllm hf lmdeploy-turbomind lmdeploy-pytorch
@@ -158,7 +181,7 @@ models:
158181
# reranker 模型
159182
- bge-reranker-base:
160183
alias: null # 别名
161-
enable: true # false true
184+
enable: true # false true 控制是否启动模型worker
162185
model_name_or_path: /home/dev/model/Xorbits/bge-reranker-base/
163186
model_type: embedding # embedding_infinity
164187
work_mode: hf

gpt_server/model_backend/lmdeploy_backend.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ async def stream_chat(self, params: Dict[str, Any]) -> AsyncGenerator:
9797
"text": text_outputs,
9898
"error_code": 0,
9999
"usage": usage,
100+
"finish_reason": request_output.finish_reason,
100101
}
101102
yield ret
102103
logger.info(text_outputs)

0 commit comments

Comments
 (0)