From 773c70687e0db608ccae188fd52952192c354ad0 Mon Sep 17 00:00:00 2001 From: Anooyman <875734078@qq.com> Date: Sun, 24 Mar 2024 15:52:12 +0800 Subject: [PATCH] Update main.py --- rag/src/main.py | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/rag/src/main.py b/rag/src/main.py index 3fa9417..f324f50 100644 --- a/rag/src/main.py +++ b/rag/src/main.py @@ -1,6 +1,3 @@ -import os -from config.config import data_dir -from data_processing import Data_process from pipeline import EmoLLMRAG from util.llm import get_glm from loguru import logger @@ -14,23 +11,6 @@ from loguru import logger ''' -def main(query, system_prompt=''): - logger.info(data_dir) - if not os.path.exists(data_dir): - os.mkdir(data_dir) - dp = Data_process() - vector_db = dp.load_vector_db() - docs, retriever = dp.retrieve(query, vector_db, k=10) - logger.info(f'Query: {query}') - logger.info("Retrieve results===============================") - for i, doc in enumerate(docs): - logger.info(doc) - passages,scores = dp.rerank(query, docs) - logger.info("After reranking===============================") - for i in range(len(scores)): - logger.info(passages[i]) - logger.info(f'score: {str(scores[i])}') - if __name__ == "__main__": query = """ 我现在处于高三阶段,感到非常迷茫和害怕。我觉得自己从出生以来就是多余的,没有必要存在于这个世界。