Satyam0077's picture
Rename streamlit app.py to app.py
d13c723 verified
raw
history blame contribute delete
597 Bytes
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")