diff --git a/koboldcpp.py b/koboldcpp.py index 1e2b8b846..d6a9835d1 100644 --- a/koboldcpp.py +++ b/koboldcpp.py @@ -3528,7 +3528,11 @@ def zenity(typ, filetypes=None, initialdir="", initialfile="", **kwargs) -> Tupl def zentk_askopenfilename(**options): try: + from os.path import isfile result = zenity('file-selection', filetypes=options.get("filetypes"), initialdir=options.get("initialdir"), title=options.get("title"))[1] + if result and not isfile(result): + print("A folder was selected while we need a file, ignoring selection.") + return '' except: from tkinter.filedialog import askopenfilename result = askopenfilename(**options) @@ -4420,7 +4424,7 @@ def show_gui(): return filenamestr = str(filename).strip() if not filenamestr.endswith(".kcppt"): - filenamestr += ".kcpps" + filenamestr += ".kcppt" file = open(filenamestr, 'w') file.write(json.dumps(savdict)) file.close()