Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make process cycling optional #53

Merged
merged 1 commit into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions horde_worker_regen/bridge_data/data_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions horde_worker_regen/process_management/process_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down