From 03faf77ee48bff3d4551efc7474eb2b18dd07f8e Mon Sep 17 00:00:00 2001 From: "l.gabrysiak" Date: Fri, 28 Feb 2025 21:34:32 +0100 Subject: [PATCH] allegro mod --- allegro.py | 5 ++--- requirements.txt | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/allegro.py b/allegro.py index b7d0b99..ba30a0e 100644 --- a/allegro.py +++ b/allegro.py @@ -5,7 +5,6 @@ from weaviate.connect import ConnectionParams import weaviate import torch -import faiss import numpy as np from sentence_transformers import SentenceTransformer from datasets import Dataset @@ -47,8 +46,8 @@ documents = fetch_documents() embeddings = embed_model.encode(documents) dim = embeddings.shape[1] -index = faiss.IndexFlatL2(dim) -index.add(np.array(embeddings, dtype=np.float32)) +#index = faiss.IndexFlatL2(dim) +#index.add(np.array(embeddings, dtype=np.float32)) def create_training_data(): data = { diff --git a/requirements.txt b/requirements.txt index f2fe19e..d08ae7e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,4 +10,5 @@ huggingface-hub>=0.16.4 numpy peft weaviate-client -sentence_transformers \ No newline at end of file +sentence_transformers +faiss-gpu \ No newline at end of file