allow drag and drop kcpps file and openwith
This commit is contained in:
parent
47f7ebb632
commit
ce065d39d0
2 changed files with 13 additions and 2 deletions
|
@ -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
|
|||
<option value="3">Metharme</option>
|
||||
<option value="4">Llama 2 Chat</option>
|
||||
<option value="5">Q & A</option>
|
||||
<option value="6">ChatML</option>
|
||||
</select>
|
||||
<table class="settingsmall text-center" style="border-spacing: 4px 2px; border-collapse: separate;">
|
||||
<tr>
|
||||
|
|
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue