From 6a79ea930bd3ce141ab534e3dfbc34f8eb737344 Mon Sep 17 00:00:00 2001 From: ZeroCool940711 Date: Wed, 14 Sep 2022 05:58:01 -0700 Subject: [PATCH] Removed condition to check if the defaults are in the st.session_state dictionary, this is not needed and would cause issues with it not being reloaded when the user changes something on it. --- scripts/webui_streamlit.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/webui_streamlit.py b/scripts/webui_streamlit.py index 9341433..c3c8aa2 100644 --- a/scripts/webui_streamlit.py +++ b/scripts/webui_streamlit.py @@ -22,12 +22,14 @@ except: # remove some annoying deprecation warnings that show every now and then. warnings.filterwarnings("ignore", category=DeprecationWarning) -if "defaults" not in st.session_state: - st.session_state["defaults"] = OmegaConf.load(os.path.join("configs","webui", "webui_streamlit.yaml")) - if (os.path.exists(os.path.join("configs","webui", "userconfig_streamlit.yaml"))): - user_defaults = OmegaConf.load(os.path.join("configs","webui", "userconfig_streamlit.yaml")); - st.session_state["defaults"] = OmegaConf.merge(st.session_state["defaults"], user_defaults) + + +st.session_state["defaults"] = OmegaConf.load(os.path.join("configs","webui", "webui_streamlit.yaml")) + +if (os.path.exists(os.path.join("configs","webui", "userconfig_streamlit.yaml"))): + user_defaults = OmegaConf.load(os.path.join("configs","webui", "userconfig_streamlit.yaml")); + st.session_state["defaults"] = OmegaConf.merge(st.session_state["defaults"], user_defaults) defaults = st.session_state["defaults"]