@@ -662,7 +662,6 @@ def show_new_gui():
662
662
return
663
663
664
664
import customtkinter as ctk
665
-
666
665
nextstate = 0 #0=exit, 1=launch, 2=oldgui
667
666
windowwidth = 520
668
667
windowheight = 500
@@ -699,6 +698,7 @@ def show_new_gui():
699
698
blasbatchsize_text = ["Don't Batch BLAS" ,"32" ,"64" ,"128" ,"256" ,"512" ,"1024" ]
700
699
contextsize_text = ["512" , "1024" , "2048" , "3072" , "4096" , "6144" , "8192" ]
701
700
runopts = [opt for lib , opt in lib_option_pairs if file_exists (lib ) or os .name == 'nt' and file_exists (opt + ".dll" )]
701
+ antirunopts = [opt .replace ("Use " , "" ) for lib , opt in lib_option_pairs if not file_exists (lib ) or os .name == 'nt' and not file_exists (opt + ".dll" )]
702
702
if not any (runopts ):
703
703
show_gui_warning ("No Backend Available" )
704
704
def tabbuttonaction (name ):
@@ -851,6 +851,24 @@ def get_device_names():
851
851
CUDA_quick_gpu_selector_box = ctk .CTkComboBox (quick_tab , values = CUdevices , width = 180 , variable = gpu_choice_var , state = "readonly" )
852
852
quick_lowvram_box = makecheckbox (quick_tab , "Low VRAM" , lowvram_var , 5 )
853
853
854
+ def show_tooltip (event , tooltip_text = None ):
855
+ if hasattr (show_tooltip , "_tooltip" ):
856
+ tooltip = show_tooltip ._tooltip
857
+ else :
858
+ tooltip = ctk .CTkToplevel (root )
859
+ tooltip .configure (fg_color = "#ffffe0" )
860
+ tooltip .withdraw ()
861
+ tooltip .overrideredirect (True )
862
+ tooltip_label = ctk .CTkLabel (tooltip , text = tooltip_text , text_color = "#000000" , fg_color = "#ffffe0" )
863
+ tooltip_label .pack (expand = True , padx = 2 , pady = 1 )
864
+ show_tooltip ._tooltip = tooltip
865
+ x , y = root .winfo_pointerxy ()
866
+ tooltip .wm_geometry (f"+{ x + 10 } +{ y + 10 } " )
867
+ tooltip .deiconify ()
868
+ def hide_tooltip (event ):
869
+ if hasattr (show_tooltip , "_tooltip" ):
870
+ tooltip = show_tooltip ._tooltip
871
+ tooltip .withdraw ()
854
872
def changerunmode (a ,b ,c ):
855
873
index = runopts_var .get ()
856
874
if index == "Use CLBlast" or index == "Use CuBLAS/hipBLAS" :
@@ -894,7 +912,12 @@ def changerunmode(a,b,c):
894
912
runoptbox = ctk .CTkComboBox (quick_tab , values = runopts , width = 180 ,variable = runopts_var , state = "readonly" )
895
913
runoptbox .grid (row = 1 , column = 1 ,padx = 8 , stick = "nw" )
896
914
runoptbox .set (runopts [0 ])
897
-
915
+ # Tell user how many backends are available
916
+ num_backends_built = makelabel (quick_tab , str (len (runopts )) + "/6" , 5 , 2 )
917
+ num_backends_built .grid (row = 1 , column = 2 , padx = 0 , pady = 0 )
918
+ num_backends_built .configure (text_color = "#00ff00" )
919
+ num_backends_built .bind ("<Enter>" , lambda event : show_tooltip (event , f"This is the number of backends you have built and available.\n Missing: { ', ' .join (antirunopts )} " ))
920
+ num_backends_built .bind ("<Leave>" , hide_tooltip )
898
921
# threads
899
922
makelabelentry (quick_tab , "Threads:" , threads_var , 8 , 50 )
900
923
@@ -905,7 +928,6 @@ def changerunmode(a,b,c):
905
928
quick_boxes = {"Launch Browser" : launchbrowser , "High Priority" : highpriority , "Streaming Mode" :stream , "Use SmartContext" :smartcontext , "Unban Tokens" :unbantokens , "Disable MMAP" :disablemmap ,}
906
929
for idx , name , in enumerate (quick_boxes ):
907
930
makecheckbox (quick_tab , name , quick_boxes [name ], int (idx / 2 ) + 20 , idx % 2 )
908
-
909
931
# context size
910
932
makeslider (quick_tab , "Context Size:" , contextsize_text , context_var , 0 , len (contextsize_text )- 1 , 30 , set = 2 )
911
933
@@ -929,6 +951,13 @@ def changerunmode(a,b,c):
929
951
runoptbox .set (runopts [0 ])
930
952
runopts_var .trace ('w' , changerunmode )
931
953
changerunmode (1 ,1 ,1 )
954
+
955
+ # Tell user how many backends are available
956
+ num_backends_built = makelabel (hardware_tab , str (len (runopts )) + "/6" , 5 , 2 )
957
+ num_backends_built .grid (row = 1 , column = 2 , padx = 0 , pady = 0 )
958
+ num_backends_built .configure (text_color = "#00ff00" )
959
+ num_backends_built .bind ("<Enter>" , show_tooltip )
960
+ num_backends_built .bind ("<Leave>" , hide_tooltip )
932
961
# threads
933
962
makelabelentry (hardware_tab , "Threads:" , threads_var , 8 , 50 )
934
963
0 commit comments