Spaces:
Sleeping
Sleeping
| import streamlit as st | |
| from rag_pipeline import QuoteRAG | |
| import json | |
| # Load RAG system | |
| rag = QuoteRAG() | |
| st.title("π RAG-Based Quote Retrieval") | |
| st.write("Ask me for quotes (e.g., *quotes about courage by women authors*)") | |
| query = st.text_input("Enter your query:") | |
| if query: | |
| results = rag.search(query, top_k=5) | |
| st.subheader("Results (JSON with similarity score 0β1, higher is better):") | |
| st.json(results) | |
| # Download option | |
| json_str = json.dumps(results, indent=2) | |
| st.download_button("π₯ Download JSON", json_str, file_name="results.json") | |