mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-02-17 12:10:49 +01:00
Added functionality to add any/all args via json
This commit is contained in:
parent
e860eb161d
commit
9dc9966433
@ -1044,6 +1044,7 @@ def general_startup(override_args=None):
|
||||
parser.add_argument("--no_aria2", action='store_true', default=False, help="Prevents KoboldAI from using aria2 to download huggingface models more efficiently, in case aria2 is causing you issues")
|
||||
parser.add_argument("--lowmem", action='store_true', help="Extra Low Memory loading for the GPU, slower but memory does not peak to twice the usage")
|
||||
parser.add_argument("--savemodel", action='store_true', help="Saves the model to the models folder even if --colab is used (Allows you to save models to Google Drive)")
|
||||
parser.add_argument("--customsettings", help="Preloads arguements from json file. You only need to provide the location of the json file. Use customsettings.json template file. It can be renamed if you wish so that you can store multiple configurations. Leave any settings you want as default as null. Any values you wish to set need to be in double quotation marks")
|
||||
#args: argparse.Namespace = None
|
||||
if "pytest" in sys.modules and override_args is None:
|
||||
args = parser.parse_args([])
|
||||
@ -1057,6 +1058,14 @@ def general_startup(override_args=None):
|
||||
else:
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.customsettings:
|
||||
f = open (args.customsettings)
|
||||
importedsettings = json.load(f)
|
||||
for items in importedsettings:
|
||||
if importedsettings[items] is not None:
|
||||
setattr(args, items, importedsettings[items])
|
||||
f.close()
|
||||
|
||||
vars.model = args.model;
|
||||
vars.revision = args.revision
|
||||
|
||||
|
3
customsettings_template.json
Normal file
3
customsettings_template.json
Normal file
@ -0,0 +1,3 @@
|
||||
{"aria2_port":null, "breakmodel":null, "breakmodel_disklayers":null, "breakmodel_gpulayers":null, "breakmodel_layers":null, "colab":null, "configname":null, "cpu":null, "host":null, "localtunnel":null, "lowmem":null, "model":null, "ngrok":null, "no_aria2":null, "noaimenu":null, "nobreakmodel":null, "override_delete":null, "override_rename":null, "path":null, "port":null, "quiet":null, "remote":null, "revision":null, "savemodel":null, "unblock":null}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user