rag_perso / src /data_processing /txt_embeddings.py
ALBERT Clement
Initial RAG
c4bf3b5
Raw
History Blame Contribute Delete
328 Bytes
# -*- coding: utf-8 -*-
"""
Created on Fri Jul 3 15:48:54 2026
@author: ALBERT
"""
from sentence_transformers import SentenceTransformer
import numpy as np
model = SentenceTransformer("all-MiniLM-L6-v2")
def compute_embeddings(chunks):
embeddings = model.encode(chunks)
return np.array(embeddings).astype("float32")