Skip to content

Commit

Permalink
Fix GUI backend count label
Browse files Browse the repository at this point in the history
  • Loading branch information
YellowRoseCx committed Dec 10, 2023
1 parent 947e75c commit a2b441a
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions koboldcpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ def bring_terminal_to_foreground():
modelbusy = threading.Lock()
requestsinqueue = 0
defaultport = 5001
KcppVersion = "1.51.1.yr1-ROCm"
KcppVersion = "1.51.1.yr2-ROCm"
showdebug = True
showsamplerwarning = True
showmaxctxwarning = True
Expand Down Expand Up @@ -990,14 +990,14 @@ def show_new_gui():
blasbatchsize_text = ["Don't Batch BLAS","32","64","128","256","512","1024","2048"]
contextsize_text = ["256", "512", "1024", "2048", "3072", "4096", "6144", "8192", "12288", "16384", "24576", "32768", "65536"]
runopts = [opt for lib, opt in lib_option_pairs if file_exists(lib)]
antirunopts = [opt.replace("Use ", "") for lib, opt in lib_option_pairs if not (opt in runopts)]
if os.name != 'nt':
if "NoAVX2 Mode (Old CPU)" in antirunopts:
antirunopts.remove("NoAVX2 Mode (Old CPU)")
if "Failsafe Mode (Old CPU)" in antirunopts:
antirunopts.remove("Failsafe Mode (Old CPU)")
if "CLBlast NoAVX2 (Old CPU)" in antirunopts:
antirunopts.remove("CLBlast NoAVX2 (Old CPU)")
antirunopts = [opt.replace("Use ", "") for lib, opt in lib_option_pairs if not (opt in runopts) and not (opt == "Use CuBLAS" and "Use hipBLAS (ROCm)" in runopts)]
# if os.name != 'nt':
# if "NoAVX2 Mode (Old CPU)" in antirunopts:
# antirunopts.remove("NoAVX2 Mode (Old CPU)")
# if "Failsafe Mode (Old CPU)" in antirunopts:
# antirunopts.remove("Failsafe Mode (Old CPU)")
# if "CLBlast NoAVX2 (Old CPU)" in antirunopts:
# antirunopts.remove("CLBlast NoAVX2 (Old CPU)")
if not any(runopts):
exitcounter = 999
show_gui_msgbox("No Backends Available!","KoboldCPP couldn't locate any backends to use (i.e Default, OpenBLAS, CLBlast, CuBLAS).\n\nTo use the program, please run the 'make' command from the directory.")
Expand Down Expand Up @@ -1366,12 +1366,12 @@ def hide_tooltip(event):
tooltip.withdraw()

def setup_backend_tooltip(parent):
num_backends_built = makelabel(parent, str(len(runopts)) + f"/{7 if os.name == 'nt' else 4}", 5, 2)
num_backends_built = makelabel(parent, str(len(runopts)) + f"/{7 if os.name == 'nt' else 7}", 5, 2)
num_backends_built.grid(row=1, column=1, padx=195, pady=0)
num_backends_built.configure(text_color="#00ff00")
# Bind the backend count label with the tooltip function
nl = '\n'
num_backends_built.bind("<Enter>", lambda event: show_tooltip(event, f"Number of backends you have built and available." + (f"\n\nMissing Backends: \n\n{nl.join(antirunopts)}" if len(runopts) != 6 else "")))
num_backends_built.bind("<Enter>", lambda event: show_tooltip(event, f"Number of backends you have built and available." + (f"\n\nMissing Backends: \n\n{nl.join(antirunopts)}" if len(runopts) != 7 else "")))
num_backends_built.bind("<Leave>", hide_tooltip)

# # Vars - should be in scope to be used by multiple widgets
Expand Down

0 comments on commit a2b441a

Please sign in to comment.