From a70fbd346e9138def135c59fb4a55adbb643a644 Mon Sep 17 00:00:00 2001 From: Luca Foppiano Date: Tue, 21 Nov 2023 17:05:01 +0900 Subject: [PATCH] cleanup --- streamlit_app.py | 67 +++++++++++++++++++++++++++++++----------------- 1 file changed, 43 insertions(+), 24 deletions(-) diff --git a/streamlit_app.py b/streamlit_app.py index d9e2ea6..1e7b10f 100644 --- a/streamlit_app.py +++ b/streamlit_app.py @@ -71,15 +71,35 @@ } ) -# css = ''' -# -# ''' -# -# st.markdown(css, unsafe_allow_html=True) +css_modify_left_column = ''' + +''' +css_modify_right_column = ''' + +''' +css_disable_scrolling_container = ''' + +''' + + +# st.markdown(css_lock_column_fixed, unsafe_allow_html=True) +# st.markdown(css2, unsafe_allow_html=True) def new_file(): @@ -231,9 +251,9 @@ def play_old_messages(): # is_api_key_provided = st.session_state['api_key'] st.button( - 'Reset chat memory.', - on_click=clear_memory(), - help="Clear the conversational memory. Currently implemented to retrain the 4 most recent messages.") + 'Reset chat memory.', + on_click=clear_memory(), + help="Clear the conversational memory. Currently implemented to retrain the 4 most recent messages.") left_column, right_column = st.columns([1, 1]) @@ -322,15 +342,15 @@ def get_pdf_display(binary): left_column.markdown(get_pdf_display(st.session_state['binary']), unsafe_allow_html=True) with right_column: - css = ''' - - ''' - st.markdown(css, unsafe_allow_html=True) + # css = ''' + # + # ''' + # st.markdown(css, unsafe_allow_html=True) # st.markdown( # """ @@ -341,7 +361,6 @@ def get_pdf_display(binary): # unsafe_allow_html=True, # ) - if st.session_state.loaded_embeddings and question and len(question) > 0 and st.session_state.doc_id: for message in st.session_state.messages: with st.chat_message(message["role"]): @@ -365,8 +384,8 @@ def get_pdf_display(binary): elif mode == "LLM": with st.spinner("Generating response..."): _, text_response = st.session_state['rqa'][model].query_document(question, st.session_state.doc_id, - context_size=context_size, - memory=st.session_state.memory) + context_size=context_size, + memory=st.session_state.memory) if not text_response: st.error("Something went wrong. Contact Luca Foppiano (Foppiano.Luca@nims.co.jp) to report the issue.")