mirror of
https://github.com/langgenius/dify.git
synced 2025-12-19 17:27:16 -05:00
add qdrant to tidb
This commit is contained in:
@@ -331,7 +331,7 @@ class Vector:
|
|||||||
collection_exist_cache_key = f"vector_indexing_{self._vector_processor.collection_name}"
|
collection_exist_cache_key = f"vector_indexing_{self._vector_processor.collection_name}"
|
||||||
redis_client.delete(collection_exist_cache_key)
|
redis_client.delete(collection_exist_cache_key)
|
||||||
|
|
||||||
def _get_embeddings(self) -> Embeddings:
|
def _get_embeddings(self) -> Embeddings | None:
|
||||||
model_manager = ModelManager()
|
model_manager = ModelManager()
|
||||||
try:
|
try:
|
||||||
embedding_model = model_manager.get_model_instance(
|
embedding_model = model_manager.get_model_instance(
|
||||||
@@ -342,7 +342,6 @@ class Vector:
|
|||||||
)
|
)
|
||||||
return CacheEmbedding(embedding_model)
|
return CacheEmbedding(embedding_model)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.exception("Error getting embeddings: %s", e)
|
|
||||||
# return default embeddings
|
# return default embeddings
|
||||||
try:
|
try:
|
||||||
default_embeddings = model_manager.get_default_model_instance(
|
default_embeddings = model_manager.get_default_model_instance(
|
||||||
@@ -351,8 +350,8 @@ class Vector:
|
|||||||
)
|
)
|
||||||
return CacheEmbedding(default_embeddings)
|
return CacheEmbedding(default_embeddings)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.exception("Error getting default embeddings: %s", e)
|
logger.info("Error getting default embeddings: %s", e)
|
||||||
raise e
|
return None
|
||||||
|
|
||||||
def _filter_duplicate_texts(self, texts: list[Document]) -> list[Document]:
|
def _filter_duplicate_texts(self, texts: list[Document]) -> list[Document]:
|
||||||
for text in texts.copy():
|
for text in texts.copy():
|
||||||
|
|||||||
Reference in New Issue
Block a user