Fix stop str merging (#225)

Co-authored-by: Enrique Shockwave <33002121+qeternity@users.noreply.github.com>
This commit is contained in:
Liangsheng Yin
2024-02-24 16:05:21 +08:00
committed by GitHub
parent 3c2c5869ad
commit c4e9ebe3a4

View File

@@ -583,6 +583,10 @@ class StreamExecutor:
if self.chat_template.stop_str:
if not clone:
clone = self.default_sampling_para.clone()
if clone.stop == ():
clone.stop = []
elif isinstance(clone.stop, str):
clone.stop = [clone.stop]
clone.stop += self.chat_template.stop_str
return clone or self.default_sampling_para