CoolFace
Apppublic

officialanushka/Root_Cause_Analysis_BOT

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
rag_engine.py15 linesDownload Raw Back to kb
1def build_kb_index(kb_path):2    texts = []3    paths = []4 5    for root, _, files in os.walk(kb_path):6        for file in files:7            with open(os.path.join(root, file), "r") as f:8                texts.append(f.read())9                paths.append(os.path.join(root, file))10 11    embeddings = embed_texts(texts)12    index = FAISS.from_embeddings(embeddings)13 14    return index, texts, paths15