From 17c679c610114067fa8e5fbdf40d23a4c667fd2a Mon Sep 17 00:00:00 2001 From: Luca Foppiano Date: Tue, 19 Dec 2023 10:36:08 +0900 Subject: [PATCH] change sliders when paragraphs are extracted --- streamlit_app.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/streamlit_app.py b/streamlit_app.py index 24f696d..01e8773 100644 --- a/streamlit_app.py +++ b/streamlit_app.py @@ -306,9 +306,14 @@ def play_old_messages(): chunk_size = st.slider("Chunks size", -1, 2000, value=-1, help="Size of chunks in which the document is partitioned", disabled=uploaded_file is not None) - context_size = st.slider("Context size", 3, 10, value=4, - help="Number of chunks to consider when answering a question", + if chunk_size == -1: + context_size = st.slider("Context size", 3, 20, value=10, + help="Number of paragraphs to consider when answering a question", disabled=not uploaded_file) + else: + context_size = st.slider("Context size", 3, 10, value=4, + help="Number of chunks to consider when answering a question", + disabled=not uploaded_file) st.session_state['ner_processing'] = st.checkbox("Identify materials and properties.") st.markdown(