fix: more modular approach for embedding dimension

This commit is contained in:
Tymec
2023-04-14 17:17:10 +02:00
parent 653904a359
commit 121f4e606c
4 changed files with 10 additions and 18 deletions

View File

@@ -6,16 +6,9 @@ from redis.commands.search.query import Query
from redis.commands.search.indexDefinition import IndexDefinition, IndexType
import numpy as np
from memory.base import MemoryProviderSingleton, get_embedding
from memory.base import MemoryProviderSingleton, get_embedding, EMBED_DIM
from logger import logger
from colorama import Fore, Style
from config import Config
# TODO: get the embeddings dimension without importing config
cfg = Config()
# set the embedding dimension based on the embeder
EMBED_DIM = 1536 if cfg.memory_embeder == "ada" else 768
SCHEMA = [
TextField("data"),