mb-rag 1.1.37__tar.gz → 1.1.38__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of mb-rag might be problematic. Click here for more details.
- {mb_rag-1.1.37 → mb_rag-1.1.38}/PKG-INFO +1 -1
- {mb_rag-1.1.37 → mb_rag-1.1.38}/mb_rag/rag/embeddings.py +7 -4
- {mb_rag-1.1.37 → mb_rag-1.1.38}/mb_rag/version.py +1 -1
- {mb_rag-1.1.37 → mb_rag-1.1.38}/mb_rag.egg-info/PKG-INFO +1 -1
- {mb_rag-1.1.37 → mb_rag-1.1.38}/README.md +0 -0
- {mb_rag-1.1.37 → mb_rag-1.1.38}/mb_rag/__init__.py +0 -0
- {mb_rag-1.1.37 → mb_rag-1.1.38}/mb_rag/chatbot/__init__.py +0 -0
- {mb_rag-1.1.37 → mb_rag-1.1.38}/mb_rag/chatbot/basic.py +0 -0
- {mb_rag-1.1.37 → mb_rag-1.1.38}/mb_rag/chatbot/chains.py +0 -0
- {mb_rag-1.1.37 → mb_rag-1.1.38}/mb_rag/chatbot/prompts.py +0 -0
- {mb_rag-1.1.37 → mb_rag-1.1.38}/mb_rag/rag/__init__.py +0 -0
- {mb_rag-1.1.37 → mb_rag-1.1.38}/mb_rag/utils/__init__.py +0 -0
- {mb_rag-1.1.37 → mb_rag-1.1.38}/mb_rag/utils/bounding_box.py +0 -0
- {mb_rag-1.1.37 → mb_rag-1.1.38}/mb_rag/utils/document_extract.py +0 -0
- {mb_rag-1.1.37 → mb_rag-1.1.38}/mb_rag/utils/extra.py +0 -0
- {mb_rag-1.1.37 → mb_rag-1.1.38}/mb_rag/utils/pdf_extract.py +0 -0
- {mb_rag-1.1.37 → mb_rag-1.1.38}/mb_rag.egg-info/SOURCES.txt +0 -0
- {mb_rag-1.1.37 → mb_rag-1.1.38}/mb_rag.egg-info/dependency_links.txt +0 -0
- {mb_rag-1.1.37 → mb_rag-1.1.38}/mb_rag.egg-info/requires.txt +0 -0
- {mb_rag-1.1.37 → mb_rag-1.1.38}/mb_rag.egg-info/top_level.txt +0 -0
- {mb_rag-1.1.37 → mb_rag-1.1.38}/pyproject.toml +0 -0
- {mb_rag-1.1.37 → mb_rag-1.1.38}/setup.cfg +0 -0
- {mb_rag-1.1.37 → mb_rag-1.1.38}/setup.py +0 -0
|
@@ -325,7 +325,8 @@ class embedding_generator:
|
|
|
325
325
|
# Initialize generator
|
|
326
326
|
gen = embedding_generator(
|
|
327
327
|
model="openai",
|
|
328
|
-
model_type="text-embedding-3-small"
|
|
328
|
+
model_type="text-embedding-3-small",
|
|
329
|
+
collection_name='test'
|
|
329
330
|
)
|
|
330
331
|
|
|
331
332
|
# Generate embeddings
|
|
@@ -335,7 +336,7 @@ class embedding_generator:
|
|
|
335
336
|
)
|
|
336
337
|
|
|
337
338
|
# Load retriever
|
|
338
|
-
retriever = gen.load_retriever('./embeddings')
|
|
339
|
+
retriever = gen.load_retriever('./embeddings', collection_name='test')
|
|
339
340
|
|
|
340
341
|
# Query embeddings
|
|
341
342
|
results = gen.query_embeddings("What is this about?")
|
|
@@ -430,12 +431,13 @@ class embedding_generator:
|
|
|
430
431
|
else:
|
|
431
432
|
return "Vector store not found"
|
|
432
433
|
|
|
433
|
-
def load_embeddings(self, embeddings_folder_path: str):
|
|
434
|
+
def load_embeddings(self, embeddings_folder_path: str,collection_name: str = 'test'):
|
|
434
435
|
"""
|
|
435
436
|
Load embeddings from folder.
|
|
436
437
|
|
|
437
438
|
Args:
|
|
438
439
|
embeddings_folder_path (str): Path to embeddings folder
|
|
440
|
+
collection_name (str): Name of the collection. Default: 'test'
|
|
439
441
|
|
|
440
442
|
Returns:
|
|
441
443
|
Optional[Chroma]: Loaded vector store or None if not found
|
|
@@ -443,7 +445,8 @@ class embedding_generator:
|
|
|
443
445
|
if self.check_file(embeddings_folder_path):
|
|
444
446
|
if self.vector_store_type == 'chroma':
|
|
445
447
|
return Chroma(persist_directory=embeddings_folder_path,
|
|
446
|
-
embedding_function=self.model
|
|
448
|
+
embedding_function=self.model,
|
|
449
|
+
collection_name=collection_name)
|
|
447
450
|
else:
|
|
448
451
|
if self.logger:
|
|
449
452
|
self.logger.info("Embeddings file not found")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|