diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 6f2509c..0000000 Binary files a/.DS_Store and /dev/null differ diff --git a/.gitignore b/.gitignore index 2fbbe88..40133ef 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,7 @@ chroma_db/ *.sqlite3 *.pkl *.pyc -*.DS_store +*.DS_Store *.ipynb_checkpoints *.csv serving/data/ @@ -16,4 +16,4 @@ tools/data/* *checkpoint* *.pid tools/data/ -tools/data/* \ No newline at end of file +tools/data/* diff --git a/tools/app.py b/tools/app.py index 002a4c2..f1b823d 100644 --- a/tools/app.py +++ b/tools/app.py @@ -81,19 +81,10 @@ def load_label_data() -> dict[int, list[str]]: topic_queries = load_csv("data/LLM Evaluation - Topic Queries.csv") -topics = topic_queries['Topic'] -print(topics) - -title_left, title_right = st.columns(spec=2, gap="medium") -with title_left: - st.write("## Query") - -with title_right: - st.write("## Is it relevant?") - +topics = topic_queries['Topic'].tolist() +st.write("## For each query, is this dataset relevant?") def update_relevancy(var, topic): - print(st.session_state[var], topic) if st.session_state[var] and topic not in st.session_state[UNSAVED_DATA][did]: st.session_state[UNSAVED_DATA][did].append(topic) if not st.session_state[var] and topic in st.session_state[UNSAVED_DATA][did]: @@ -101,28 +92,20 @@ def update_relevancy(var, topic): with st.container(height=400): - query_left, relevant_right = st.columns(spec=2) - - with query_left: - for topic in topics: - st.write(topic) - - with relevant_right: - for i, topic in enumerate(topics): - def update_this_relevancy(var_, topic_): - """Helper function to bind the variables to scope.""" - return lambda: update_relevancy(f"q{var_}", topic_) - - # We need to use the on_change callbacks instead of the regular - # return values, because state needs to be up-to-date *before* - # the next render pass. - st.checkbox( - label=f"q{i}", - label_visibility="hidden", - value=(topic in st.session_state[UNSAVED_DATA][did]), - key=f"q{i}", - on_change=update_this_relevancy(i, topic), - ) + for i, topic in enumerate(topics): + def update_this_relevancy(var_, topic_): + """Helper function to bind the variables to scope.""" + return lambda: update_relevancy(f"q{var_}", topic_) + + # We need to use the on_change callbacks instead of the regular + # return values, because state needs to be up-to-date *before* + # the next render pass. + st.checkbox( + label=topic, + value=(topic in st.session_state[UNSAVED_DATA][did]), + key=f"q{i}", + on_change=update_this_relevancy(i, topic), + ) unsaved_changes = (st.session_state[UNSAVED_DATA] != st.session_state[LOADED_DATA])