Update app.py
Browse files705 unmodified lines706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737705 unmodified linesreturn answerdef update_vectors(files, use_recursive_splitter):if not files:return "Please upload at least one PDF file."embed = get_embeddings()total_chunks = 0all_data = []for file in files:if use_recursive_splitter:data = load_and_split_document_recursive(file)else:data = load_and_split_document_basic(file)all_data.extend(data)total_chunks += len(data)if os.path.exists("faiss_database"):database = FAISS.load_local("faiss_database", embed, allow_dangerous_deserialization=True)database.add_documents(all_data)else:database = FAISS.from_documents(all_data, embed)database.save_local("faiss_database")return f"Vector store updated successfully. Processed {total_chunks} chunks from {len(files)} files."def extract_db_to_excel():embed = get_embeddings()database = FAISS.load_local("faiss_database", embed, allow_dangerous_deserialization=True)705 unmodified lines706707708709710711705 unmodified linesreturn answerdef extract_db_to_excel():embed = get_embeddings()database = FAISS.load_local("faiss_database", embed, allow_dangerous_deserialization=True)
app.py-26