File size: 443 Bytes
479a9a1
 
 
 
 
 
 
3711c26
479a9a1
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
import streamlit as st
from document_processor import read_documents, chunk_data
from embeddings_store import create_embeddings_and_store

@st.cache_resource
def initialize_rag_chain():
    try:
        docs = read_documents("maindataset.pdf")
        doc_chunks = chunk_data(docs)
        return create_embeddings_and_store(doc_chunks)
    except Exception as e:
        st.error(f"Error initializing RAG chain: {str(e)}")
        return None