From 91b64c6f6044c71b6a7ac5e36b9a1aad43bf4e40 Mon Sep 17 00:00:00 2001 From: tazlin Date: Sun, 24 Mar 2024 11:01:13 -0400 Subject: [PATCH] fix: `purge_loras_on_download` option in bridgeData --- horde_worker_regen/bridge_data/data_model.py | 2 ++ horde_worker_regen/download_models.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/horde_worker_regen/bridge_data/data_model.py b/horde_worker_regen/bridge_data/data_model.py index 06545a17..ca72e6c2 100644 --- a/horde_worker_regen/bridge_data/data_model.py +++ b/horde_worker_regen/bridge_data/data_model.py @@ -70,6 +70,8 @@ class reGenBridgeData(CombinedHordeBridgeData): exit_on_unhandled_faults: bool = Field(default=False) + purge_loras_on_download: bool = Field(default=False) + @model_validator(mode="after") def validate_performance_modes(self) -> reGenBridgeData: """Validate the performance modes and set the appropriate values. diff --git a/horde_worker_regen/download_models.py b/horde_worker_regen/download_models.py index 04fa4745..0f0cdbc1 100644 --- a/horde_worker_regen/download_models.py +++ b/horde_worker_regen/download_models.py @@ -59,7 +59,7 @@ def download_all_models( SharedModelManager.load_model_managers() - if purge_unused_loras: + if purge_unused_loras or bridge_data.purge_loras_on_download: logger.info("Purging unused LORAs...") if SharedModelManager.manager.lora is None: logger.error("Failed to load LORA model manager")