mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-10 05:15:42 +08:00
Fix: Output text is always truncated in some models (#3016)
This commit is contained in:
parent
703e42ee4b
commit
54d3544784
@ -980,7 +980,10 @@ class LLMEngine:
|
|||||||
def _finalize_sequence(self, seq: Sequence,
|
def _finalize_sequence(self, seq: Sequence,
|
||||||
sampling_params: SamplingParams,
|
sampling_params: SamplingParams,
|
||||||
stop_string: str) -> None:
|
stop_string: str) -> None:
|
||||||
if not sampling_params.include_stop_str_in_output and stop_string:
|
if sampling_params.include_stop_str_in_output:
|
||||||
|
return
|
||||||
|
|
||||||
|
if stop_string and seq.output_text.endswith(stop_string):
|
||||||
# Truncate the output text so that the stop string is
|
# Truncate the output text so that the stop string is
|
||||||
# not included in the output.
|
# not included in the output.
|
||||||
seq.output_text = seq.output_text[:-len(stop_string)]
|
seq.output_text = seq.output_text[:-len(stop_string)]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user