Skip to content

Commit 9ee9a77

Browse files
committed
warn outdated GUI (+1 squashed commits)
Squashed commits: [15aec3d] spelling error
1 parent 32102c2 commit 9ee9a77

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

koboldcpp.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -997,10 +997,18 @@ def switch_old_gui():
997997
time.sleep(2)
998998
sys.exit(2)
999999

1000+
def show_gui_warning():
1001+
from tkinter import messagebox
1002+
import tkinter as tk
1003+
root = tk.Tk()
1004+
root.attributes("-alpha", 0)
1005+
messagebox.showerror(title="New GUI failed, using Old GUI", message="The new GUI failed to load.\n\nTo use new GUI, please install the customtkinter python module.")
1006+
root.destroy()
10001007

10011008
def show_old_gui():
10021009
import tkinter as tk
10031010
from tkinter.filedialog import askopenfilename
1011+
from tkinter import messagebox
10041012

10051013
if len(sys.argv) == 1:
10061014
#no args passed at all. Show nooby gui
@@ -1078,7 +1086,7 @@ def onDropdownChange(event):
10781086

10791087
# Create button, it will change label text
10801088
tk.Button(root , text = "Launch", font = ("Impact", 18), bg='#54FA9B', command = guilaunch ).grid(row=6,column=0)
1081-
tk.Label(root, text = "(Please use the Command Line for more advanced options)",
1089+
tk.Label(root, text = "(Please use the Command Line for more advanced options)\nThis GUI is deprecated. Please install customtkinter.",
10821090
font = ("Arial", 9)).grid(row=7,column=0)
10831091

10841092
root.mainloop()
@@ -1166,9 +1174,11 @@ def main(args):
11661174
show_new_gui()
11671175
except Exception as ex:
11681176
print("Failed to use new GUI. Reason: " + str(ex))
1169-
print("Attempting to us old GUI...")
1177+
print("Make sure customtkinter is installed!!!")
1178+
print("Attempting to use old GUI...")
11701179
if not args.model_param:
11711180
try:
1181+
show_gui_warning()
11721182
show_old_gui()
11731183
except Exception as ex2:
11741184
print("File selection GUI unsupported. Please check command line: script.py --help")

0 commit comments

Comments
 (0)