diff --git a/python/llm/src/bigdl/llm/ggml/model/starcoder/starcoder.py b/python/llm/src/bigdl/llm/ggml/model/starcoder/starcoder.py index e54392d7..3432a180 100644 --- a/python/llm/src/bigdl/llm/ggml/model/starcoder/starcoder.py +++ b/python/llm/src/bigdl/llm/ggml/model/starcoder/starcoder.py @@ -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,