From 97bc7e3fb6f52aeb61e23ec18a8cff560ed6391c Mon Sep 17 00:00:00 2001 From: gavin660 <43652996+gavin660@users.noreply.github.com> Date: Wed, 31 May 2023 10:43:22 -0700 Subject: [PATCH] Adds functionality for user to set flags via environment variable (#59) --- webui.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/webui.py b/webui.py index aa6f6ab7..4c2354d5 100644 --- a/webui.py +++ b/webui.py @@ -14,6 +14,14 @@ conda_env_path = os.path.join(script_dir, "installer_files", "env") CMD_FLAGS = '--chat --model-menu' +# Allows users to set flags in "OOBABOOGA_FLAGS" environment variable +if "OOBABOOGA_FLAGS" in os.environ: + CMD_FLAGS = os.environ["OOBABOOGA_FLAGS"] + print("\33[1;32mFlags have been taken from enivroment Variable 'OOBABOOGA_FLAGS'\33[0m") + print(CMD_FLAGS) + print("\33[1;32mTo use flags from webui.py remove 'OOBABOOGA_FLAGS'\33[0m") + + def run_cmd(cmd, assert_success=False, environment=False, capture_output=False, env=None): # Use the conda environment if environment: