From 942ad6067d9fbd5158db60331a1cd09e8c7ee918 Mon Sep 17 00:00:00 2001 From: Cebtenzzre Date: Fri, 18 Aug 2023 23:17:27 -0400 Subject: [PATCH] llama.cpp: make Stop button work with streaming disabled (#3620) --- modules/llamacpp_model.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/llamacpp_model.py b/modules/llamacpp_model.py index 28a38de..69cbd23 100644 --- a/modules/llamacpp_model.py +++ b/modules/llamacpp_model.py @@ -125,6 +125,8 @@ class LlamaCppModel: output = "" for completion_chunk in completion_chunks: + if shared.stop_everything: + break text = completion_chunk['choices'][0]['text'] output += text if callback: