From 36722903391ec42d5458112bc0549eb843548d90 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Fri, 12 Apr 2024 09:05:32 +0200 Subject: Update ui --- rag/ui.py | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) (limited to 'rag') diff --git a/rag/ui.py b/rag/ui.py index 82c6d47..40da9dd 100644 --- a/rag/ui.py +++ b/rag/ui.py @@ -32,19 +32,30 @@ def upload(files): if __name__ == "__main__": load_dotenv() retriever = load_retriever() - ss = st.session_state - st.title("Retrieval Augmented Generation") - model = st.selectbox("Generative Model", options=MODELS) - generator = load_generator(model) + with st.sidebar: + st.header("Grouding") + st.markdown( + ( + "These files will be uploaded to the knowledge base and used " + "as groudning if they are relevant to the question." + ) + ) + + files = st.file_uploader( + "Choose pdfs to add to the knowledge base", + type="pdf", + accept_multiple_files=True, + ) + + upload(files) - files = st.file_uploader( - "Choose pdfs to add to the knowledge base", - type="pdf", - accept_multiple_files=True, - ) + st.header("Generative Model") + st.markdown("Select the model that will be used for generating the answer.") + model = st.selectbox("Generative Model", options=MODELS) + generator = load_generator(model) - upload(files) + st.title("Retrieval Augmented Generation") with st.form(key="query"): query = st.text_area( -- cgit v1.2.3-70-g09d2