olamideba commited on
Commit
aa09b44
·
1 Parent(s): 55609c0

add bge-small-finetuned and bge-large-finetunes chromadb collections

Browse files
Files changed (2) hide show
  1. app/src/chroma.py +2 -2
  2. app/src/settings.py +3 -2
app/src/chroma.py CHANGED
@@ -4,9 +4,9 @@ from chromadb import Collection, QueryResult
4
  from chromadb.api import ClientAPI
5
  from pandas import DataFrame
6
  from src.sentence import sentence_embed
7
- from src.settings import CHROMA_COLLECTION, CHROMA_DIR
8
 
9
- chroma_client: ClientAPI = chromadb.PersistentClient(path=CHROMA_DIR)
10
  chroma_collection: Collection = chroma_client.get_or_create_collection(
11
  name=CHROMA_COLLECTION, metadata={"hnsw:space": "cosine"}
12
  )
 
4
  from chromadb.api import ClientAPI
5
  from pandas import DataFrame
6
  from src.sentence import sentence_embed
7
+ from src.settings import CHROMA_COLLECTION, CHROMA_DB
8
 
9
+ chroma_client: ClientAPI = chromadb.PersistentClient(path=CHROMA_DB)
10
  chroma_collection: Collection = chroma_client.get_or_create_collection(
11
  name=CHROMA_COLLECTION, metadata={"hnsw:space": "cosine"}
12
  )
app/src/settings.py CHANGED
@@ -8,9 +8,10 @@ load_dotenv(find_dotenv())
8
 
9
  SRC_DIR: str = os.path.dirname(__file__)
10
  DATA_DIR: str = os.path.join(SRC_DIR, "../../data")
11
- CHROMA_DIR: str = os.path.join(SRC_DIR, "../../.chroma")
12
  MODELS_DIR: str = os.path.join(SRC_DIR, "../../models")
13
- CHROMA_COLLECTION: str = "bge_small_finetuned_astra_collection_10k"
 
 
14
 
15
 
16
  class Settings(BaseSettings):
 
8
 
9
  SRC_DIR: str = os.path.dirname(__file__)
10
  DATA_DIR: str = os.path.join(SRC_DIR, "../../data")
 
11
  MODELS_DIR: str = os.path.join(SRC_DIR, "../../models")
12
+ CHROMA_DIR: str = os.path.join(SRC_DIR, "../../.chroma")
13
+ CHROMA_DB: str = os.path.join(CHROMA_DIR, "bge-small-finetuned-chroma")
14
+ CHROMA_COLLECTION: str = "bge_small_finetuned_astra_collection" # use bge_small_finetuned_astra_collection for the bege-large model and embeddings
15
 
16
 
17
  class Settings(BaseSettings):