diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2024-04-08 00:45:44 +0200 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2024-04-08 00:45:44 +0200 |
commit | 5f777ecdfbf486e5057d31547bdc53358037dce0 (patch) | |
tree | 97aac82ad802e6d3164d001a889b82da60ddaaa1 /rag | |
parent | 8211705debf9d1335223c606275f46c43c78d8a2 (diff) |
Update ui
Diffstat (limited to 'rag')
-rw-r--r-- | rag/ui.py | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -22,6 +22,7 @@ def upload_pdfs(): if __name__ == "__main__": + ss = st.session_state st.header("RAG-UI") upload_pdfs() @@ -35,10 +36,13 @@ if __name__ == "__main__": disabled=False, ) + (b,) = st.columns(1) (result_column, context_column) = st.columns(2) - if query: - response = rag.retrive(query) + if b.button("Generate", disabled=False, type="primary", use_container_width=True): + query = ss.get("query", "") + with st.spinner("Generating answer..."): + response = rag.retrieve(query) with result_column: st.markdown("### Answer") |