From 84ac4e2deedd1d91d6fa13224e94ed0e06759f8f Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Sat, 3 Dec 2022 19:37:33 +0000 Subject: [PATCH] dict update syntax improvement to list_models() This is a code cleanup enhancement originally contributed by @devops117 which didn't get into the 2.2 release. Reissuing the PR now in order to base against main. --- ldm/invoke/model_cache.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ldm/invoke/model_cache.py b/ldm/invoke/model_cache.py index 7d1654718a3..f881fb6c565 100644 --- a/ldm/invoke/model_cache.py +++ b/ldm/invoke/model_cache.py @@ -145,10 +145,14 @@ def list_models(self) -> dict: else: status = 'not loaded' - models[name]={ - 'status' : status, - 'description' : description - } + models.update( + { + name: { + 'status' : status, + 'description' : description + } + } + ) return models def print_models(self) -> None: