summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2024-04-05 00:42:19 +0200
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2024-04-05 00:42:19 +0200
commit0a6b7793e982d4c59f3c6ffb947dfe28ca709cdc (patch)
tree10ae6893d2c901b04f63c5f9e15cb2678b87ce98
parent1cf0a401054c3e3ebde60bfd73ad15e39bc531e6 (diff)
Rename
-rw-r--r--rag/db/embeddings.py (renamed from rag/db/vector.py)10
1 files changed, 5 insertions, 5 deletions
diff --git a/rag/db/vector.py b/rag/db/embeddings.py
index f229ba7..f9d0735 100644
--- a/rag/db/vector.py
+++ b/rag/db/embeddings.py
@@ -1,15 +1,15 @@
+import os
from typing import Tuple
+
import faiss
import numpy as np
-# TODO: read from .env
-EMBEDDING_DIM = 1024
-
# TODO: inner product distance metric?
-class VectorStore:
+class Embeddings:
def __init__(self):
- self.index = faiss.IndexFlatL2(EMBEDDING_DIM)
+ self.dim = os.environ["EMBEDDING_DIM"]
+ self.index = faiss.IndexFlatL2(self.dim)
# TODO: load from file
def add(self, embeddings: np.ndarray):