Skip to content

Commit 1931670

Browse files
authored
fix duplicated stop_token_string when ignore_special_tokens is False (#4077)
* fix stop response * fix slice
1 parent c5b34f1 commit 1931670

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lmdeploy/serve/async_engine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,7 @@ def is_error(status):
862862
if output_len and outputs.token_ids[-1] in stop_ids:
863863
hit_stop_token = 1
864864

865-
token_ids += outputs.token_ids
865+
token_ids += outputs.token_ids[:output_len - hit_stop_token]
866866
gen_len = len(token_ids) - input_len
867867

868868
ids_offset = state.ids_offset

0 commit comments

Comments
 (0)