Update index.py
This commit is contained in:
parent
58f7cbf669
commit
96a083fd72
2
index.py
2
index.py
@ -47,7 +47,7 @@ def main():
|
|||||||
print(f"Découpé {len(docs)} passages, génération des embeddings…")
|
print(f"Découpé {len(docs)} passages, génération des embeddings…")
|
||||||
|
|
||||||
model = BGEM3FlagModel(MODEL_NAME, device="cpu")
|
model = BGEM3FlagModel(MODEL_NAME, device="cpu")
|
||||||
emb = model.encode(docs, batch_size=64, normalize_embeddings=True)
|
emb = model.encode(docs, batch_size=64, normalize=True)
|
||||||
|
|
||||||
index = faiss.IndexFlatIP(emb.shape[1])
|
index = faiss.IndexFlatIP(emb.shape[1])
|
||||||
index.add(emb.astype("float32"))
|
index.add(emb.astype("float32"))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user