mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2025-09-10 17:14:36 +00:00
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
|
@ -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