From b7fc8e644a71c5c7e5eb2e8376ef0beeda9bd419 Mon Sep 17 00:00:00 2001 From: Concedo <39025047+LostRuins@users.noreply.github.com> Date: Wed, 24 Jul 2024 20:47:05 +0800 Subject: [PATCH] fix broken template, updated lite --- klite.embd | 12 ++++++++++-- koboldcpp.py | 6 ++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/klite.embd b/klite.embd index 74d7a18de..8a3d5edac 100644 --- a/klite.embd +++ b/klite.embd @@ -13077,7 +13077,11 @@ Current version indicated by LITEVER below. { found = gentxt.indexOf(st2); splitresponse = []; - if (found != -1) //if found, truncate to it + if(found == 0) + { + gentxt = gentxt.slice(st2.length); + } + else if (found != -1) //if found, truncate to it { splitresponse = gentxt.split(st2); gentxt = splitresponse[0]; @@ -13087,7 +13091,11 @@ Current version indicated by LITEVER below. { found = gentxt.indexOf(et2); splitresponse = []; - if (found != -1) //if found, truncate to it + if(found == 0) + { + gentxt = gentxt.slice(et2.length); + } + else if (found != -1) //if found, truncate to it { splitresponse = gentxt.split(et2); gentxt = splitresponse[0]; diff --git a/koboldcpp.py b/koboldcpp.py index be1b9f5c3..b77ba90bb 100644 --- a/koboldcpp.py +++ b/koboldcpp.py @@ -3690,6 +3690,12 @@ def main(launch_args,start_server=True): canload = True except Exception as ex: print(ex) + elif isinstance(args.chatcompletionsadapter, dict): + try: + chatcompl_adapter = json.loads(json.dumps(args.chatcompletionsadapter)) + canload = True + except Exception as ex: + print(ex) if canload: print(f"Chat Completions Adapter Loaded") else: