Skip to content

Commit 9d5efd6

Browse files
committed
dont print full base64 for images
1 parent 143b611 commit 9d5efd6

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

koboldcpp.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3029,7 +3029,17 @@ def do_POST(self):
30293029
}}).encode())
30303030
return
30313031

3032-
utfprint("\nInput: " + json.dumps(genparams),1)
3032+
3033+
tmpimgs = genparams.get("images", []) # reduce amount of text printed to terminal when dumping large images
3034+
if tmpimgs and isinstance(tmpimgs, (list, tuple)) and len(tmpimgs)>0:
3035+
printablegenparams = copy.deepcopy(genparams)
3036+
outarr = []
3037+
for img in tmpimgs:
3038+
outarr.append(str(img[:512])+"...")
3039+
printablegenparams["images"] = outarr
3040+
utfprint("\nInput: " + json.dumps(printablegenparams),1)
3041+
else:
3042+
utfprint("\nInput: " + json.dumps(genparams),1)
30333043

30343044
if args.foreground:
30353045
bring_terminal_to_foreground()

0 commit comments

Comments
 (0)