summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rag/ui.py31
1 files changed, 21 insertions, 10 deletions
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(