@@ -359,9 +359,9 @@ def pick_existant_file(ntoption,nonntoption):
359359 (lib_hipblas , "Use hipBLAS (ROCm)" ),
360360 (lib_vulkan , "Use Vulkan" ),
361361 (lib_noavx2 , "Use CPU (Old CPU)" ),
362- (lib_clblast_noavx2 , "Use CLBlast (Old CPU)" ),
363362 (lib_vulkan_noavx2 , "Use Vulkan (Old CPU)" ),
364- (lib_failsafe , "Failsafe Mode (Old CPU)" )]
363+ (lib_clblast_noavx2 , "Use CLBlast (Older CPU)" ),
364+ (lib_failsafe , "Failsafe Mode (Older CPU)" )]
365365default_option , clblast_option , cublas_option , hipblas_option , vulkan_option , noavx2_option , clblast_noavx2_option , vulkan_noavx2_option , failsafe_option = (opt if file_exists (lib ) or (os .name == 'nt' and file_exists (opt + ".dll" )) else None for lib , opt in lib_option_pairs )
366366runopts = [opt for lib , opt in lib_option_pairs if file_exists (lib )]
367367
@@ -3124,7 +3124,7 @@ def setup_backend_tooltip(parent):
31243124 nl = '\n '
31253125 tooltxt = "Number of backends you have built and available." + (f"\n \n Missing Backends: \n \n { nl .join (antirunopts )} " if len (runopts ) < 8 else "" )
31263126 num_backends_built = makelabel (parent , str (len (runopts )) + "/8" , 5 , 2 ,tooltxt )
3127- num_backends_built .grid (row = 1 , column = 1 , padx = 195 , pady = 0 )
3127+ num_backends_built .grid (row = 1 , column = 1 , padx = 205 , pady = 0 )
31283128 num_backends_built .configure (text_color = "#00ff00" )
31293129
31303130 def gui_changed_modelfile (* args ):
@@ -3143,7 +3143,7 @@ def changed_gpulayers_estimate(*args):
31433143 predicted_gpu_layers = autoset_gpu_layers (int (contextsize_text [context_var .get ()]),(sd_quant_var .get ()== 1 ),int (blasbatchsize_values [int (blas_size_var .get ())]))
31443144 max_gpu_layers = (f"/{ modelfile_extracted_meta [0 ][0 ]+ 3 } " if (modelfile_extracted_meta and modelfile_extracted_meta [0 ] and modelfile_extracted_meta [0 ][0 ]!= 0 ) else "" )
31453145 index = runopts_var .get ()
3146- gpu_be = (index == "Use Vulkan" or index == "Use Vulkan (Old CPU)" or index == "Use CLBlast" or index == "Use CLBlast (Old CPU)" or index == "Use CuBLAS" or index == "Use hipBLAS (ROCm)" )
3146+ gpu_be = (index == "Use Vulkan" or index == "Use Vulkan (Old CPU)" or index == "Use CLBlast" or index == "Use CLBlast (Older CPU)" or index == "Use CuBLAS" or index == "Use hipBLAS (ROCm)" )
31473147 layercounter_label .grid (row = 6 , column = 1 , padx = 75 , sticky = "W" )
31483148 quick_layercounter_label .grid (row = 6 , column = 1 , padx = 75 , sticky = "W" )
31493149 if sys .platform == "darwin" and gpulayers_var .get ()== "-1" :
@@ -3174,7 +3174,7 @@ def changed_gpu_choice_var(*args):
31743174 if v == "Use Vulkan" or v == "Use Vulkan (Old CPU)" :
31753175 quick_gpuname_label .configure (text = VKDevicesNames [s ])
31763176 gpuname_label .configure (text = VKDevicesNames [s ])
3177- elif v == "Use CLBlast" or v == "Use CLBlast (Old CPU)" :
3177+ elif v == "Use CLBlast" or v == "Use CLBlast (Older CPU)" :
31783178 quick_gpuname_label .configure (text = CLDevicesNames [s ])
31793179 gpuname_label .configure (text = CLDevicesNames [s ])
31803180 else :
@@ -3231,12 +3231,12 @@ def changerunmode(a,b,c):
32313231 global runmode_untouched
32323232 runmode_untouched = False
32333233 index = runopts_var .get ()
3234- if index == "Use Vulkan" or index == "Use Vulkan (Old CPU)" or index == "Use CLBlast" or index == "Use CLBlast (Old CPU)" or index == "Use CuBLAS" or index == "Use hipBLAS (ROCm)" :
3234+ if index == "Use Vulkan" or index == "Use Vulkan (Old CPU)" or index == "Use CLBlast" or index == "Use CLBlast (Older CPU)" or index == "Use CuBLAS" or index == "Use hipBLAS (ROCm)" :
32353235 quick_gpuname_label .grid (row = 3 , column = 1 , padx = 75 , sticky = "W" )
32363236 gpuname_label .grid (row = 3 , column = 1 , padx = 75 , sticky = "W" )
32373237 gpu_selector_label .grid (row = 3 , column = 0 , padx = 8 , pady = 1 , stick = "nw" )
32383238 quick_gpu_selector_label .grid (row = 3 , column = 0 , padx = 8 , pady = 1 , stick = "nw" )
3239- if index == "Use CLBlast" or index == "Use CLBlast (Old CPU)" :
3239+ if index == "Use CLBlast" or index == "Use CLBlast (Older CPU)" :
32403240 gpu_selector_box .grid (row = 3 , column = 1 , padx = 8 , pady = 1 , stick = "nw" )
32413241 quick_gpu_selector_box .grid (row = 3 , column = 1 , padx = 8 , pady = 1 , stick = "nw" )
32423242 CUDA_gpu_selector_box .grid_remove ()
@@ -3280,7 +3280,7 @@ def changerunmode(a,b,c):
32803280 else :
32813281 quick_use_flashattn .grid (row = 22 , column = 1 , padx = 8 , pady = 1 , stick = "nw" )
32823282
3283- if index == "Use Vulkan" or index == "Use Vulkan (Old CPU)" or index == "Use CLBlast" or index == "Use CLBlast (Old CPU)" or index == "Use CuBLAS" or index == "Use hipBLAS (ROCm)" :
3283+ if index == "Use Vulkan" or index == "Use Vulkan (Old CPU)" or index == "Use CLBlast" or index == "Use CLBlast (Older CPU)" or index == "Use CuBLAS" or index == "Use hipBLAS (ROCm)" :
32843284 gpu_layers_label .grid (row = 6 , column = 0 , padx = 8 , pady = 1 , stick = "nw" )
32853285 gpu_layers_entry .grid (row = 6 , column = 1 , padx = 8 , pady = 1 , stick = "nw" )
32863286 quick_gpu_layers_label .grid (row = 6 , column = 0 , padx = 8 , pady = 1 , stick = "nw" )
@@ -3302,7 +3302,7 @@ def changerunmode(a,b,c):
33023302 # presets selector
33033303 makelabel (quick_tab , "Presets:" , 1 ,0 ,"Select a backend to use.\n CuBLAS runs on Nvidia GPUs, and is much faster.\n Vulkan and CLBlast works on all GPUs but is somewhat slower.\n Otherwise, runs on CPU only.\n NoAVX2 and Failsafe modes support older PCs." )
33043304
3305- runoptbox = ctk .CTkComboBox (quick_tab , values = runopts , width = 180 ,variable = runopts_var , state = "readonly" )
3305+ runoptbox = ctk .CTkComboBox (quick_tab , values = runopts , width = 190 ,variable = runopts_var , state = "readonly" )
33063306 runoptbox .grid (row = 1 , column = 1 ,padx = 8 , stick = "nw" )
33073307 runoptbox .set (runopts [0 ]) # Set to first available option
33083308
@@ -3636,9 +3636,9 @@ def export_vars():
36363636 args .noavx2 = False
36373637 if gpu_choice_var .get ()!= "All" :
36383638 gpuchoiceidx = int (gpu_choice_var .get ())- 1
3639- if runopts_var .get () == "Use CLBlast" or runopts_var .get () == "Use CLBlast (Old CPU)" :
3639+ if runopts_var .get () == "Use CLBlast" or runopts_var .get () == "Use CLBlast (Older CPU)" :
36403640 args .useclblast = [[0 ,0 ], [1 ,0 ], [0 ,1 ], [1 ,1 ]][gpuchoiceidx ]
3641- if runopts_var .get () == "Use CLBlast (Old CPU)" :
3641+ if runopts_var .get () == "Use CLBlast (Older CPU)" :
36423642 args .noavx2 = True
36433643 if runopts_var .get () == "Use CuBLAS" or runopts_var .get () == "Use hipBLAS (ROCm)" :
36443644 if gpu_choice_var .get ()== "All" :
@@ -3664,7 +3664,7 @@ def export_vars():
36643664 args .usecpu = True
36653665 if runopts_var .get ()== "Use CPU (Old CPU)" :
36663666 args .noavx2 = True
3667- if runopts_var .get ()== "Failsafe Mode (Old CPU)" :
3667+ if runopts_var .get ()== "Failsafe Mode (Older CPU)" :
36683668 args .noavx2 = True
36693669 args .usecpu = True
36703670 args .nommap = True
@@ -4517,6 +4517,9 @@ def main(launch_args,start_server=True):
45174517 global libname , args , friendlymodelname , friendlysdmodelname , fullsdmodelpath , mmprojpath , password , fullwhispermodelpath
45184518
45194519 args = launch_args
4520+ if (args .version ) and len (sys .argv ) <= 2 :
4521+ print (f"{ KcppVersion } " ) # just print version and exit
4522+ return
45204523 if (args .model_param or args .model ) and args .prompt and not args .benchmark and not (args .debugmode >= 1 ):
45214524 suppress_stdout ()
45224525
@@ -5164,6 +5167,7 @@ def range_checker(arg: str):
51645167
51655168 #more advanced params
51665169 advparser = parser .add_argument_group ('Advanced Commands' )
5170+ advparser .add_argument ("--version" , help = "Prints version and exits." , action = 'store_true' )
51675171 advparser .add_argument ("--ropeconfig" , help = "If set, uses customized RoPE scaling from configured frequency scale and frequency base (e.g. --ropeconfig 0.25 10000). Otherwise, uses NTK-Aware scaling set automatically based on context size. For linear rope, simply set the freq-scale and ignore the freq-base" ,metavar = ('[rope-freq-scale]' , '[rope-freq-base]' ), default = [0.0 , 10000.0 ], type = float , nargs = '+' )
51685172 advparser .add_argument ("--blasbatchsize" , help = "Sets the batch size used in BLAS processing (default 512). Setting it to -1 disables BLAS mode, but keeps other benefits like GPU offload." , type = int ,choices = [- 1 ,32 ,64 ,128 ,256 ,512 ,1024 ,2048 ], default = 512 )
51695173 advparser .add_argument ("--blasthreads" , help = "Use a different number of threads during BLAS if specified. Otherwise, has the same value as --threads" ,metavar = ('[threads]' ), type = int , default = 0 )
0 commit comments