From 7f6ad9653e598cb4ab69ea8aee0a881bfa90d0c7 Mon Sep 17 00:00:00 2001 From: Jyong <76649700+JohnJyong@users.noreply.github.com> Date: Wed, 11 Oct 2023 20:48:35 +0800 Subject: [PATCH] Fix/grpc gevent compatible (#1314) Co-authored-by: jyong --- api/app.py | 3 +++ api/core/index/vector_index/milvus.py | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/api/app.py b/api/app.py index 7a0a61db7..ef32ad44e 100644 --- a/api/app.py +++ b/api/app.py @@ -6,6 +6,9 @@ from werkzeug.exceptions import Unauthorized if not os.environ.get("DEBUG") or os.environ.get("DEBUG").lower() != 'true': from gevent import monkey monkey.patch_all() + if os.environ.get("VECTOR_STORE") == 'milvus': + import grpc.experimental.gevent + grpc.experimental.gevent.init_gevent() import logging import json diff --git a/api/core/index/vector_index/milvus.py b/api/core/index/vector_index/milvus.py index 067d48b5a..013172d82 100644 --- a/api/core/index/vector_index/milvus.py +++ b/api/core/index/vector_index/milvus.py @@ -167,8 +167,6 @@ class Milvus(VectorStore): self._init() @property - - def embeddings(self) -> Embeddings: return self.embedding_func