Merge pull request #1122 from ZeroCool940711/dev

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.
This commit is contained in:
ZeroCool 2022-09-14 06:06:09 -07:00 committed by GitHub
commit fe015d2267
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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"]