From 9d5efd68b66dc1cdadfd898a336e212424dee8c4 Mon Sep 17 00:00:00 2001 From: Concedo <39025047+LostRuins@users.noreply.github.com> Date: Thu, 20 Mar 2025 21:20:04 +0800 Subject: [PATCH] dont print full base64 for images --- koboldcpp.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/koboldcpp.py b/koboldcpp.py index 05ffdf82d..a24582f1c 100644 --- a/koboldcpp.py +++ b/koboldcpp.py @@ -3029,7 +3029,17 @@ Enter Prompt:
}}).encode()) return - utfprint("\nInput: " + json.dumps(genparams),1) + + tmpimgs = genparams.get("images", []) # reduce amount of text printed to terminal when dumping large images + if tmpimgs and isinstance(tmpimgs, (list, tuple)) and len(tmpimgs)>0: + printablegenparams = copy.deepcopy(genparams) + outarr = [] + for img in tmpimgs: + outarr.append(str(img[:512])+"...") + printablegenparams["images"] = outarr + utfprint("\nInput: " + json.dumps(printablegenparams),1) + else: + utfprint("\nInput: " + json.dumps(genparams),1) if args.foreground: bring_terminal_to_foreground()