Skip to content

Commit f1fc68c

Browse files
Merge branch 'v1.0.0' of https://github.com/InternLM/lagent into v1.0.0
2 parents dfdba28 + 8d28a4f commit f1fc68c

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

lagent/llms/lmdeploy_wrapper.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ def __init__(self,
3333
StatusCode.TRITON_SERVER_ERR: ModelStatusCode.SERVER_ERR,
3434
StatusCode.TRITON_SESSION_CLOSED: ModelStatusCode.SESSION_CLOSED,
3535
StatusCode.TRITON_STREAM_ING: ModelStatusCode.STREAM_ING,
36-
StatusCode.TRITON_SESSION_OUT_OF_LIMIT: ModelStatusCode.
37-
SESSION_OUT_OF_LIMIT,
38-
StatusCode.TRITON_SESSION_INVALID_ARG: ModelStatusCode.
39-
SESSION_INVALID_ARG,
36+
StatusCode.TRITON_SESSION_OUT_OF_LIMIT:
37+
ModelStatusCode.SESSION_OUT_OF_LIMIT,
38+
StatusCode.TRITON_SESSION_INVALID_ARG:
39+
ModelStatusCode.SESSION_INVALID_ARG,
4040
StatusCode.TRITON_SESSION_READY: ModelStatusCode.SESSION_READY
4141
}
4242
self.chatbot = Chatbot(
@@ -232,9 +232,12 @@ def __init__(self,
232232
**kwargs):
233233

234234
super().__init__(path=path, **kwargs)
235-
from lmdeploy import pipeline
235+
from lmdeploy import TurbomindEngineConfig, pipeline
236236
self.model = pipeline(
237-
model_path=self.path, model_name=model_name, tp=tp, **pipeline_cfg)
237+
model_path=self.path,
238+
model_name=model_name,
239+
backend_config=TurbomindEngineConfig(tp=tp),
240+
**pipeline_cfg)
238241

239242
def generate(self,
240243
inputs: Union[str, List[str]],

0 commit comments

Comments
 (0)