From b9dcba7762398e12c77b9b60b1ec810cd0885f75 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Sat, 15 Apr 2023 11:58:55 -0300 Subject: [PATCH] Don't overwrite --gpu_memory on boot (#1237/#1235) --- server.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/server.py b/server.py index 78c027c9..fee8902a 100644 --- a/server.py +++ b/server.py @@ -221,10 +221,11 @@ def update_model_parameters(state, initial=False): found_positive = True break - if found_positive: - shared.args.gpu_memory = [f"{i}MiB" for i in gpu_memories] - else: - shared.args.gpu_memory = None + if not (initial and vars(shared.args)['gpu_memory'] != vars(shared.args_defaults)['gpu_memory']): + if found_positive: + shared.args.gpu_memory = [f"{i}MiB" for i in gpu_memories] + else: + shared.args.gpu_memory = None def get_model_specific_settings(model):