mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2025-09-11 01:24:36 +00:00
added ignoremissing param
This commit is contained in:
parent
ec5dea14d7
commit
f3b7651102
1 changed files with 51 additions and 27 deletions
34
koboldcpp.py
34
koboldcpp.py
|
@ -2686,6 +2686,8 @@ def main(launch_args,start_server=True):
|
||||||
if args.config and len(args.config)==1:
|
if args.config and len(args.config)==1:
|
||||||
if isinstance(args.config[0], str) and os.path.exists(args.config[0]):
|
if isinstance(args.config[0], str) and os.path.exists(args.config[0]):
|
||||||
loadconfigfile(args.config[0])
|
loadconfigfile(args.config[0])
|
||||||
|
elif args.ignoremissing:
|
||||||
|
print("Ignoring missing kcpp config file...")
|
||||||
else:
|
else:
|
||||||
global exitcounter
|
global exitcounter
|
||||||
exitcounter = 999
|
exitcounter = 999
|
||||||
|
@ -2781,23 +2783,35 @@ def main(launch_args,start_server=True):
|
||||||
#handle loading text model
|
#handle loading text model
|
||||||
if args.model_param:
|
if args.model_param:
|
||||||
if not os.path.exists(args.model_param):
|
if not os.path.exists(args.model_param):
|
||||||
exitcounter = 999
|
|
||||||
print(f"Cannot find text model file: {args.model_param}")
|
print(f"Cannot find text model file: {args.model_param}")
|
||||||
|
if args.ignoremissing:
|
||||||
|
print(f"Ignoring missing model file...")
|
||||||
|
args.model_param = None
|
||||||
|
else:
|
||||||
|
exitcounter = 999
|
||||||
time.sleep(3)
|
time.sleep(3)
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
|
|
||||||
if args.lora and args.lora[0]!="":
|
if args.lora and args.lora[0]!="":
|
||||||
if not os.path.exists(args.lora[0]):
|
if not os.path.exists(args.lora[0]):
|
||||||
exitcounter = 999
|
|
||||||
print(f"Cannot find lora file: {args.lora[0]}")
|
print(f"Cannot find lora file: {args.lora[0]}")
|
||||||
|
if args.ignoremissing:
|
||||||
|
print(f"Ignoring missing lora file...")
|
||||||
|
args.lora = None
|
||||||
|
else:
|
||||||
|
exitcounter = 999
|
||||||
time.sleep(3)
|
time.sleep(3)
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
else:
|
else:
|
||||||
args.lora[0] = os.path.abspath(args.lora[0])
|
args.lora[0] = os.path.abspath(args.lora[0])
|
||||||
if len(args.lora) > 1:
|
if len(args.lora) > 1:
|
||||||
if not os.path.exists(args.lora[1]):
|
if not os.path.exists(args.lora[1]):
|
||||||
exitcounter = 999
|
|
||||||
print(f"Cannot find lora base: {args.lora[1]}")
|
print(f"Cannot find lora base: {args.lora[1]}")
|
||||||
|
if args.ignoremissing:
|
||||||
|
print(f"Ignoring missing lora file...")
|
||||||
|
args.lora = None
|
||||||
|
else:
|
||||||
|
exitcounter = 999
|
||||||
time.sleep(3)
|
time.sleep(3)
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
else:
|
else:
|
||||||
|
@ -2805,8 +2819,12 @@ def main(launch_args,start_server=True):
|
||||||
|
|
||||||
if args.mmproj and args.mmproj!="":
|
if args.mmproj and args.mmproj!="":
|
||||||
if not os.path.exists(args.mmproj):
|
if not os.path.exists(args.mmproj):
|
||||||
exitcounter = 999
|
|
||||||
print(f"Cannot find mmproj file: {args.mmproj}")
|
print(f"Cannot find mmproj file: {args.mmproj}")
|
||||||
|
if args.ignoremissing:
|
||||||
|
print(f"Ignoring missing mmproj file...")
|
||||||
|
args.mmproj = None
|
||||||
|
else:
|
||||||
|
exitcounter = 999
|
||||||
time.sleep(3)
|
time.sleep(3)
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
else:
|
else:
|
||||||
|
@ -2838,10 +2856,15 @@ def main(launch_args,start_server=True):
|
||||||
if args.sdconfig:
|
if args.sdconfig:
|
||||||
imgmodel = args.sdconfig[0]
|
imgmodel = args.sdconfig[0]
|
||||||
if not imgmodel or not os.path.exists(imgmodel):
|
if not imgmodel or not os.path.exists(imgmodel):
|
||||||
exitcounter = 999
|
|
||||||
print(f"Cannot find image model file: {imgmodel}")
|
print(f"Cannot find image model file: {imgmodel}")
|
||||||
|
if args.ignoremissing:
|
||||||
|
print(f"Ignoring missing sdconfig img model file...")
|
||||||
|
args.sdconfig = None
|
||||||
|
else:
|
||||||
|
exitcounter = 999
|
||||||
time.sleep(3)
|
time.sleep(3)
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
|
else:
|
||||||
imgmodel = os.path.abspath(imgmodel)
|
imgmodel = os.path.abspath(imgmodel)
|
||||||
fullsdmodelpath = imgmodel
|
fullsdmodelpath = imgmodel
|
||||||
friendlysdmodelname = os.path.basename(imgmodel)
|
friendlysdmodelname = os.path.basename(imgmodel)
|
||||||
|
@ -3066,5 +3089,6 @@ if __name__ == '__main__':
|
||||||
parser.add_argument("--sdconfig", help="Specify a stable diffusion safetensors model to enable image generation. If quick is specified, force optimal generation settings for speed.",metavar=('[sd_filename]', '[normal|quick|clamped] [threads] [quant|noquant]'), nargs='+')
|
parser.add_argument("--sdconfig", help="Specify a stable diffusion safetensors model to enable image generation. If quick is specified, force optimal generation settings for speed.",metavar=('[sd_filename]', '[normal|quick|clamped] [threads] [quant|noquant]'), nargs='+')
|
||||||
parser.add_argument("--mmproj", help="Select a multimodal projector file for LLaVA.", default="")
|
parser.add_argument("--mmproj", help="Select a multimodal projector file for LLaVA.", default="")
|
||||||
parser.add_argument("--password", help="Enter a password required to use this instance. This key will be required for all text endpoints. Image endpoints are not secured.", default=None)
|
parser.add_argument("--password", help="Enter a password required to use this instance. This key will be required for all text endpoints. Image endpoints are not secured.", default=None)
|
||||||
|
parser.add_argument("--ignoremissing", help="Ignores all missing non-essential files, just skipping them instead.", action='store_true')
|
||||||
|
|
||||||
main(parser.parse_args(),start_server=True)
|
main(parser.parse_args(),start_server=True)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue