diff --git a/horde_worker_regen/bridge_data/data_model.py b/horde_worker_regen/bridge_data/data_model.py index 78ec66dd..7e5dfcb4 100644 --- a/horde_worker_regen/bridge_data/data_model.py +++ b/horde_worker_regen/bridge_data/data_model.py @@ -25,6 +25,10 @@ class reGenBridgeData(CombinedHordeBridgeData): _yaml_loader: YAML | None = None + cycle_process_on_model_change: bool = Field( + default=False, + ) + def load_env_vars(self) -> None: """Load the environment variables into the config model.""" if self.models_folder_parent and os.getenv("AIWORKER_CACHE_HOME") is None: diff --git a/horde_worker_regen/process_management/process_manager.py b/horde_worker_regen/process_management/process_manager.py index 19e90127..49245339 100644 --- a/horde_worker_regen/process_management/process_manager.py +++ b/horde_worker_regen/process_management/process_manager.py @@ -1213,6 +1213,7 @@ def preload_models(self) -> bool: if ( available_process.last_process_state != HordeProcessState.WAITING_FOR_JOB and available_process.loaded_horde_model_name is not None + and self.bridge_data.cycle_process_on_model_change ): # We're going to restart the process and then exit the loop, because # available_process is very quickly _not_ going to be available.