From bd0d9039ec4825d7c448682a353b36ea39ca96c6 Mon Sep 17 00:00:00 2001 From: Concedo <39025047+LostRuins@users.noreply.github.com> Date: Sun, 24 Dec 2023 20:03:33 +0800 Subject: [PATCH] better approach to multiuser check --- koboldcpp.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/koboldcpp.py b/koboldcpp.py index d65a22285..c7a07cc93 100755 --- a/koboldcpp.py +++ b/koboldcpp.py @@ -394,7 +394,7 @@ maxhordelen = 256 modelbusy = threading.Lock() requestsinqueue = 0 defaultport = 5001 -KcppVersion = "1.53" +KcppVersion = "1.53.1" showdebug = True showsamplerwarning = True showmaxctxwarning = True @@ -766,7 +766,7 @@ Enter Prompt:
elif self.path.endswith('/api/extra/generate/check'): pendtxtStr = "" - if requestsinqueue==0 and totalgens>0 and (not args.multiuser or currentusergenkey==""): + if requestsinqueue==0 and totalgens>0 and currentusergenkey=="": pendtxt = handle.get_pending_output() pendtxtStr = ctypes.string_at(pendtxt).decode("UTF-8","ignore") response_body = (json.dumps({"results": [{"text": pendtxtStr}]}).encode()) @@ -861,7 +861,7 @@ Enter Prompt:
multiuserkey = "" if totalgens>0: - if (multiuserkey=="" and multiuserkey==currentusergenkey) or (multiuserkey=="" and requestsinqueue==0 and not args.multiuser) or (multiuserkey!="" and multiuserkey==currentusergenkey): #avoid leaking prompts in multiuser + if (multiuserkey=="" and multiuserkey==currentusergenkey and requestsinqueue==0) or (multiuserkey!="" and multiuserkey==currentusergenkey): #avoid leaking prompts in multiuser pendtxt = handle.get_pending_output() pendtxtStr = ctypes.string_at(pendtxt).decode("UTF-8","ignore") response_body = (json.dumps({"results": [{"text": pendtxtStr}]}).encode())