From 4f94247910c1785b4fa15dc5eb81d664978a3f91 Mon Sep 17 00:00:00 2001 From: 0cc4m Date: Mon, 8 May 2023 22:56:17 +0200 Subject: [PATCH] Fix chat mode empty generation error --- utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils.py b/utils.py index 89b9fb4f..54083339 100644 --- a/utils.py +++ b/utils.py @@ -714,7 +714,7 @@ def applyoutputformatting(txt, no_sentence_trimming=False, no_single_line=False) txt = replaceblanklines(txt) # trim off starting new lines in replies if we're in chat mode - if koboldai_vars.chatmode and txt[0] == "\n": + if koboldai_vars.chatmode and txt and txt[0] == "\n": txt = txt[1:] # Remove special characters