Skip to content

Commit

Permalink
Fix bug of lmdeploy.LMDeployServer (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
liujiangning30 committed Jan 31, 2024
1 parent baeed6e commit fda8691
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lagent/llms/lmdepoly_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ def __init__(self,
serve_cfg=dict(),
**kwargs):
super().__init__(path=path, **kwargs)
self.model_name = model_name
# TODO get_logger issue in multi processing
import lmdeploy
self.client = lmdeploy.serve(
Expand Down Expand Up @@ -332,7 +333,7 @@ def generate(self,

resp = [''] * len(inputs)
for text in self.client.completions_v1(
self.path,
self.model_name,
inputs,
session_id=session_id,
sequence_start=sequence_start,
Expand Down Expand Up @@ -382,7 +383,7 @@ def stream_chat(self,
finished = False
stop_words = self.gen_params.get('stop_words')
for text in self.client.completions_v1(
self.path,
self.model_name,
prompt,
session_id=session_id,
sequence_start=sequence_start,
Expand Down

0 comments on commit fda8691

Please sign in to comment.