Skip to content

Commit

Permalink
fix close
Browse files Browse the repository at this point in the history
  • Loading branch information
irexyc committed Mar 7, 2024
1 parent d10f100 commit 6a77145
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lmdeploy/serve/async_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ def stream_response(self):
self.history.append((self._prompt, resp.text))

def close(self):
_ = self.response()
if self._engine:
inst = self._engine.create_instance()
inst.end(self._id)
inst.cancel(self._id)
_ = self.response()

def __repr__(self) -> str:
_ = self.response()
Expand Down Expand Up @@ -668,6 +668,7 @@ def _work_thread():
gen_config=gen_config,
stream_output=True):
_, res, tokens = outputs
print(session._id, tokens)
response, state = self.tokenizer.detokenize_incrementally(
res,
state,
Expand Down

0 comments on commit 6a77145

Please sign in to comment.