LLM: support stop for starcoder native int4 stream (#8734)
This commit is contained in:
parent
e292dfd970
commit
ca3e59a1dc
1 changed files with 4 additions and 0 deletions
|
|
@ -295,6 +295,10 @@ class Starcoder(GenerationMixin):
|
||||||
text = self.detokenize([token]).decode("utf-8", errors="ignore")
|
text = self.detokenize([token]).decode("utf-8", errors="ignore")
|
||||||
if text.endswith("<|endoftext|>"):
|
if text.endswith("<|endoftext|>"):
|
||||||
print('\n')
|
print('\n')
|
||||||
|
return
|
||||||
|
elif text is not None and text in stop:
|
||||||
|
print('\n')
|
||||||
|
return
|
||||||
else:
|
else:
|
||||||
yield {
|
yield {
|
||||||
"id": completion_id,
|
"id": completion_id,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue