From ce065d39d089df59e8614d2fea0bb08fcf08bf04 Mon Sep 17 00:00:00 2001 From: Concedo <39025047+LostRuins@users.noreply.github.com> Date: Thu, 5 Oct 2023 11:38:37 +0800 Subject: [PATCH] allow drag and drop kcpps file and openwith --- klite.embd | 7 ++++++- koboldcpp.py | 8 +++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/klite.embd b/klite.embd index ec4ed5960..db3120a74 100644 --- a/klite.embd +++ b/klite.embd @@ -6224,6 +6224,10 @@ Current version: 75 document.getElementById('instruct_starttag').value = "\\nQuestion: "; document.getElementById('instruct_endtag').value = "\\nAnswer: "; break; + case "6": //ChatML + document.getElementById('instruct_starttag').value = "<|im_start|>user"; + document.getElementById('instruct_endtag').value = "<|im_start|>assistant"; + break; default: break; } @@ -9208,7 +9212,7 @@ Current version: 75 this.bubbleColor_AI = 'rgb(20, 20, 40)'; this.background_margin = [5, 5, 5, 0]; - this.background_padding = [15, 15, 10, 10]; + this.background_padding = [15, 15, 10, 5]; this.background_minHeight = 80; this.centerHorizontally = false; @@ -10216,6 +10220,7 @@ Current version: 75 + diff --git a/koboldcpp.py b/koboldcpp.py index e8db68360..f8f6f2634 100755 --- a/koboldcpp.py +++ b/koboldcpp.py @@ -791,7 +791,6 @@ def show_new_gui(): args.model_param = askopenfilename(title="Select ggml model .bin or .gguf file or .kcpps config") root.destroy() if args.model_param and args.model_param!="" and args.model_param.lower().endswith('.kcpps'): - print("\nLoading configuration...") loadconfigfile(args.model_param) if not args.model_param: print("\nNo ggml model or kcpps file was selected. Exiting.") @@ -1585,6 +1584,7 @@ def unload_libs(): handle = None def loadconfigfile(filename): + print("Loading kcpps configuration file...") with open(filename, 'r') as f: config = json.load(f) for key, value in config.items(): @@ -1601,8 +1601,14 @@ def main(launch_args,start_server=True): print("Specified kcpp config file invalid or not found.") time.sleep(3) sys.exit(2) + + #positional handling for kcpps files (drag and drop) + if args.model_param and args.model_param!="" and args.model_param.lower().endswith('.kcpps'): + loadconfigfile(args.model_param) + if not args.model_param: args.model_param = args.model + if not args.model_param: #give them a chance to pick a file print("For command line arguments, please refer to --help")