From b2144c9c4af720ff00e4ca55e69c734513bc0935 Mon Sep 17 00:00:00 2001 From: Gleb Belov Date: Thu, 7 Mar 2024 20:29:43 +1100 Subject: [PATCH] Start ModelExplorer #232 --- support/modelexplore/.streamlit/config.toml | 4 ++++ support/modelexplore/modelexplore.py | 26 +++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 support/modelexplore/.streamlit/config.toml create mode 100644 support/modelexplore/modelexplore.py diff --git a/support/modelexplore/.streamlit/config.toml b/support/modelexplore/.streamlit/config.toml new file mode 100644 index 000000000..53093a751 --- /dev/null +++ b/support/modelexplore/.streamlit/config.toml @@ -0,0 +1,4 @@ +[server] +enableXsrfProtection = false +enableCORS = false + diff --git a/support/modelexplore/modelexplore.py b/support/modelexplore/modelexplore.py new file mode 100644 index 000000000..6fcfaee7e --- /dev/null +++ b/support/modelexplore/modelexplore.py @@ -0,0 +1,26 @@ + +import streamlit as st + +# To work in st 1.30.1, see +# https://discuss.streamlit.io/t/axioserror-request-failed-with-status-code-403/38112/13 +input_file = st.file_uploader("Model file (JSONL)") + +left_column, right_column = st.columns(2) + +# You can use a column just like st.sidebar: +srch = left_column.text_input('Search pattern:') + +# Or even better, call Streamlit functions inside a "with" block: +fwd = right_column.checkbox('Add descendants', disabled=True) +bwd = right_column.checkbox('Add ancestors', disabled=True) + +if input_file is not None: + with left_column: + bytes_data = input_file.read() + st.write("NL model") + st.write(bytes_data) + with right_column: + st.write("Flat model") +else: + with left_column: + st.write("No file selected.")