LLM: support stop for starcoder native int4 stream (#8734)

This commit is contained in:
Ruonan Wang 2023-08-11 14:51:30 +08:00 committed by GitHub
parent e292dfd970
commit ca3e59a1dc

View file

@ -295,6 +295,10 @@ class Starcoder(GenerationMixin):
text = self.detokenize([token]).decode("utf-8", errors="ignore")
if text.endswith("<|endoftext|>"):
print('\n')
return
elif text is not None and text in stop:
print('\n')
return
else:
yield {
"id": completion_id,