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

@@ -3,14 +3,9 @@ import orjson
from typing import Any, List, Optional
import numpy as np
import os
from memory.base import MemoryProviderSingleton, get_embedding
from config import Config
from memory.base import MemoryProviderSingleton, get_embedding, EMBED_DIM
# 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
SAVE_OPTIONS = orjson.OPT_SERIALIZE_NUMPY | orjson.OPT_SERIALIZE_DATACLASS