diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2024-04-12 09:05:32 +0200 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2024-04-12 09:05:32 +0200 |
commit | 36722903391ec42d5458112bc0549eb843548d90 (patch) | |
tree | 3b2ab9879b3fcc94883c7d167803864f368a6179 | |
parent | 22f8971e6c0ca0abbec8b588ef30a642fb9ec871 (diff) |
Update ui
-rw-r--r-- | rag/ui.py | 31 |
1 files changed, 21 insertions, 10 deletions
@@ -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( |