From 2259143fecdc1cdaaefee9bce8ad58fba625fda8 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Fri, 31 Mar 2023 18:43:45 -0300 Subject: [PATCH] Fix llama.cpp with --no-stream --- modules/llamacpp_model.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/llamacpp_model.py b/modules/llamacpp_model.py index 6b9b1b5..1c67afb 100644 --- a/modules/llamacpp_model.py +++ b/modules/llamacpp_model.py @@ -1,8 +1,5 @@ -from pathlib import Path - import llamacpp -import modules.shared as shared from modules.callbacks import Iteratorize @@ -65,6 +62,7 @@ class LlamaCppModel: self.model.eval() token = self.model.sample() text = self.model.token_to_str(token) + output += text is_end_of_text = token == self.model.token_eos() if callback: callback(text)