From d812c9a84f2c530919ddffec8bf4024cce841e6b Mon Sep 17 00:00:00 2001 From: wxywb Date: Tue, 28 May 2024 15:25:56 +0800 Subject: [PATCH] fix: Convert cohere embedding to np.float32 (#24) --- milvus_model/dense/cohere.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/milvus_model/dense/cohere.py b/milvus_model/dense/cohere.py index 0231a2d..aa467fc 100644 --- a/milvus_model/dense/cohere.py +++ b/milvus_model/dense/cohere.py @@ -49,7 +49,7 @@ def _call_cohere_api(self, texts: List[str], input_type: str) -> List[np.array]: truncate=self.truncate ).embeddings if self.embedding_types is None: - results = [np.array(data) for data in embeddings] + results = [np.array(data, dtype=np.float32) for data in embeddings] else: results = getattr(embeddings, self.embedding_types[0], None) if self.embedding_types[0] == "binary":