mirror of https://github.com/vllm-project/vllm
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,
|
||||
sampling_params: SamplingParams,
|
||||
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
|
||||
# not included in the output.
|
||||
seq.output_text = seq.output_text[:-len(stop_string)]
|
||||
|
|
Loading…
Reference in New Issue