mirror of
				https://github.com/KoboldAI/KoboldAI-Client.git
				synced 2025-06-05 21:59:24 +02:00 
			
		
		
		
	Automatically use breakmodel instead of GPU-only where supported
There's really no reason to use GPU-only mode if breakmodel is supported because breakmodel can run in GPU-only mode too.
This commit is contained in:
		
							
								
								
									
										20
									
								
								aiserver.py
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								aiserver.py
									
									
									
									
									
								
							| @@ -314,12 +314,12 @@ if(not vars.model in ["InferKit", "Colab", "OAI", "ReadOnly"]): | ||||
|             genselected = True | ||||
|             vars.usegpu = True | ||||
|             vars.breakmodel = False | ||||
|         if(vars.bmsupported): | ||||
|             vars.usegpu = False | ||||
|             vars.breakmodel = True | ||||
|         if(args.cpu): | ||||
|             vars.usegpu = False | ||||
|             vars.breakmodel = False | ||||
|         if(vars.bmsupported and args.breakmodel): | ||||
|             vars.usegpu = False | ||||
|             vars.breakmodel = True | ||||
|     elif(vars.hascuda):     | ||||
|         if(vars.bmsupported): | ||||
|             print(colors.YELLOW + "You're using a model that supports hybrid generation!") | ||||
| @@ -327,9 +327,8 @@ if(not vars.model in ["InferKit", "Colab", "OAI", "ReadOnly"]): | ||||
|             print("(slower than GPU-only but uses less VRAM) or between multiple GPUs") | ||||
|             print("(allowing you to use the combined VRAM of all your GPUs).") | ||||
|             print("Currently only GPT-Neo and GPT-J models support this feature.") | ||||
|         print("{0}Use GPU or CPU for generation?:  (Default GPU){1}".format(colors.CYAN, colors.END)) | ||||
|         if(vars.bmsupported): | ||||
|             print(f"    1 - GPU\n    2 - CPU\n    3 - Hybrid generation\n") | ||||
|             print("{0}Use hybrid generation or CPU-only generation?:  (Default hybrid){1}".format(colors.CYAN, colors.END)) | ||||
|             print(f"    1 - Hybrid generation\n    2 - CPU\n") | ||||
|         else: | ||||
|             print("    1 - GPU\n    2 - CPU\n") | ||||
|         genselected = False | ||||
| @@ -342,6 +341,11 @@ if(not vars.model in ["InferKit", "Colab", "OAI", "ReadOnly"]): | ||||
|                 vars.usegpu = True | ||||
|                 genselected = True | ||||
|             elif(genselect.isnumeric() and int(genselect) == 1): | ||||
|                 if(vars.bmsupported): | ||||
|                     vars.breakmodel = True | ||||
|                     vars.usegpu = False | ||||
|                     genselected = True | ||||
|                 else: | ||||
|                     vars.breakmodel = False | ||||
|                     vars.usegpu = True | ||||
|                     genselected = True | ||||
| @@ -349,10 +353,6 @@ if(not vars.model in ["InferKit", "Colab", "OAI", "ReadOnly"]): | ||||
|                 vars.breakmodel = False | ||||
|                 vars.usegpu = False | ||||
|                 genselected = True | ||||
|             elif(vars.bmsupported and genselect.isnumeric() and int(genselect) == 3): | ||||
|                 vars.breakmodel = True | ||||
|                 vars.usegpu = False | ||||
|                 genselected = True | ||||
|             else: | ||||
|                 print("{0}Please enter a valid selection.{1}".format(colors.RED, colors.END)) | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Gnome Ann
					Gnome Ann