From 64664dc61ea8b5008666b8d91b9454576a45d328 Mon Sep 17 00:00:00 2001 From: ebolam Date: Thu, 11 Aug 2022 10:40:32 -0400 Subject: [PATCH] Fix for the AI menu to respect the --cpu command line flag --- aiserver.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aiserver.py b/aiserver.py index cd8b081e..5deeb688 100644 --- a/aiserver.py +++ b/aiserver.py @@ -1209,6 +1209,8 @@ def get_model_info(model, directory=""): url = True elif not utils.HAS_ACCELERATE and not torch.cuda.is_available(): pass + elif args.cpu: + pass else: layer_count = get_layer_count(model, directory=directory) if layer_count is None: @@ -3460,7 +3462,7 @@ def get_message(msg): else: filename = "settings/{}.breakmodel".format(vars.model.replace('/', '_')) f = open(filename, "w") - f.write(msg['gpu_layers'] + '\n' + msg['disk_layers']) + f.write(str(msg['gpu_layers']) + '\n' + str(msg['disk_layers'])) f.close() vars.colaburl = msg['url'] + "/request" load_model(use_gpu=msg['use_gpu'], gpu_layers=msg['gpu_layers'], disk_layers=msg['disk_layers'], online_model=msg['online_model'])