Spaces:
Build error
Build error
SHAMIL SHAHBAZ AWAN commited on
Update app.py
Browse files16 unmodified lines171819202122232461 unmodified lines86878889909114 unmodified lines10610710810911011116 unmodified linesbackground-position: center center;background-repeat: no-repeat;}}/* Set title and footer text color to black */h1, h2, h3, h4, h5, h6, p {{color: black; /* Set text color to black */}}61 unmodified lines# If the index file doesn't exist, create a new oneindex = faiss.IndexFlatL2(embedder.get_sentence_embedding_dimension())# Function to load text from PDFdef load_pdf_text(file_path):"""Extract text from the given PDF file."""14 unmodified lines# Process the document and update vector storedef process_and_store_document(file_path):"""Process the PDF document, chunk text, generate embeddings, and store them in FAISS."""st.info("Processing PDF document...")# Extract text from the PDF file16 unmodified lines171819202122232425262728293061 unmodified lines929394959697989910014 unmodified lines11511611711811912012112216 unmodified linesbackground-position: center center;background-repeat: no-repeat;}}/* Ensure title is black */h1 {{color: black !important; /* Force title color to black */}}/* Set footer text color to white */h2, h3, h4, h5, h6, p {{color: black; /* Set text color to black */}}61 unmodified lines# If the index file doesn't exist, create a new oneindex = faiss.IndexFlatL2(embedder.get_sentence_embedding_dimension())# Variable to hold chunks globallychunks = []# Function to load text from PDFdef load_pdf_text(file_path):"""Extract text from the given PDF file."""14 unmodified lines# Process the document and update vector storedef process_and_store_document(file_path):"""Process the PDF document, chunk text, generate embeddings, and store them in FAISS."""global chunks # Make chunks global to access in the query partst.info("Processing PDF document...")# Extract text from the PDF file
app.py+13-2