From 93ce68aea018c62c7c58aa6dc78a3fc067e6575c Mon Sep 17 00:00:00 2001 From: shiyu22 Date: Mon, 29 May 2023 15:53:56 +0800 Subject: [PATCH] Add eqa inseert Signed-off-by: shiyu22 --- eqa_insert.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/eqa_insert.py b/eqa_insert.py index 9a179c1..93bd3c3 100644 --- a/eqa_insert.py +++ b/eqa_insert.py @@ -26,7 +26,6 @@ class EnhancedQAInsertConfig: self.source_type = 'file' # config for sentence_embedding self.model = 'all-MiniLM-L6-v2' - self.dim = None self.openai_api_key = None self.customize_embedding_op = None self.normalize_vec = True @@ -70,9 +69,6 @@ def _get_embedding_op(config): @AutoPipes.register def enhanced_qa_insert_pipe(config): - if not config: - config = EnhancedQAInsertConfig() - text_load_op = ops.text_loader() allow_triton, sentence_embedding_op = _get_embedding_op(config) @@ -97,7 +93,7 @@ def enhanced_qa_insert_pipe(config): ) if config.normalize_vec: - p = p.map('vec', 'vec', ops.towhee.np_normalize()) + p = p.map('embedding', 'embedding', ops.towhee.np_normalize()) return (p.map(('doc', 'sentence', 'embedding'), 'mr', insert_milvus_op) .output('mr')