Skip to content

Commit

Permalink
complement
Browse files Browse the repository at this point in the history
  • Loading branch information
AllentDan committed Nov 7, 2023
1 parent f7b8ca2 commit bad1c38
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lmdeploy/serve/async_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ async def generate(
prompt = messages
if do_preprocess:
prompt = self.model.messages2prompt(prompt, sequence_start)
input_ids = self.tokenizer.encode(prompt, sequence_start)
input_ids = self.tokenizer.encode(prompt, add_bos=sequence_start)
finish_reason = 'stop' if stop else None
if self.steps[str(session_id)] + len(
input_ids) + request_output_len >= self.tm_model.session_len:
Expand Down
2 changes: 1 addition & 1 deletion lmdeploy/serve/turbomind/chatbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ def _stream_infer(self,
session.sequence_length = 0

input_ids, input_lengths = self.preprocess(prompt)
# got input_ids with default sequence_start == True
# got input_ids with default add_bos == True
if not sequence_start and input_ids[0][0] == self.bos_id:
input_ids = input_ids[:, 1:]
input_lengths = input_lengths - 1
Expand Down

0 comments on commit bad1c38

Please sign in to comment.