From 263b5abf9815dad45116e86aae23139e6049e6d6 Mon Sep 17 00:00:00 2001 From: Taku <163737696+xinsenyan@users.noreply.github.com> Date: Mon, 11 Aug 2025 16:29:56 +0800 Subject: [PATCH 1/3] Update synonym.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改打开文件编码 --- rag/nlp/synonym.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rag/nlp/synonym.py b/rag/nlp/synonym.py index 8c2418b..becc4fb 100644 --- a/rag/nlp/synonym.py +++ b/rag/nlp/synonym.py @@ -30,7 +30,7 @@ def __init__(self, redis=None): self.dictionary = None path = os.path.join(get_project_base_directory(), "rag/res", "synonym.json") try: - self.dictionary = json.load(open(path, "r")) + self.dictionary = json.load(open(path, "r", encoding="utf-8")) except Exception: logging.warning("Missing synonym.json") self.dictionary = {} From c6dc2100ca732f6c316948aed30a10b926ad822b Mon Sep 17 00:00:00 2001 From: Taku <163737696+xinsenyan@users.noreply.github.com> Date: Mon, 11 Aug 2025 16:30:29 +0800 Subject: [PATCH 2/3] Update term_weight.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改打开文件编码 --- rag/nlp/term_weight.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rag/nlp/term_weight.py b/rag/nlp/term_weight.py index df4d2a9..e01d1a0 100644 --- a/rag/nlp/term_weight.py +++ b/rag/nlp/term_weight.py @@ -85,7 +85,7 @@ def load_dict(fnm): fnm = os.path.join(get_project_base_directory(), "rag/res") self.ne, self.df = {}, {} try: - self.ne = json.load(open(os.path.join(fnm, "ner.json"), "r")) + self.ne = json.load(open(os.path.join(fnm, "ner.json"), "r", encoding="utf-8")) except Exception: logging.warning("Load ner.json FAIL!") try: From 1d58b58118df755170b7b2b4d75236f61bce7827 Mon Sep 17 00:00:00 2001 From: Taku <163737696+xinsenyan@users.noreply.github.com> Date: Mon, 11 Aug 2025 16:31:57 +0800 Subject: [PATCH 3/3] Update prompts.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改引用提示词细节 --- rag/prompts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rag/prompts.py b/rag/prompts.py index 34e6499..0836118 100644 --- a/rag/prompts.py +++ b/rag/prompts.py @@ -201,7 +201,7 @@ def citation_prompt(): : 埃隆·马斯克对 Dogecoin 的看法是什么? -: 马斯克一贯表达了对 Dogecoin 的喜爱,常常提及其幽默感和品牌中狗的元素。他曾表示这是他最喜欢的加密货币 ##0 ##1。 +: 马斯克一贯表达了对 Dogecoin 的喜爱,常常提及其幽默感和品牌中狗的元素。他曾表示这是他最喜欢的加密货币 ##0$$ ##1$$。 最近,马斯克暗示 Dogecoin 未来可能会有新的应用场景。他的推文引发了关于 Dogecoin 可能被整合到公共服务中的猜测 ##3$$。 总体而言,虽然马斯克喜欢 Dogecoin 并经常推广它,但他也警告不要过度投资,反映了他对其投机性质的既喜爱又谨慎的态度。