diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 410766f2b..b67b74f60 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -74,7 +74,7 @@ repos: name: Unused noqa - repo: https://github.com/pycqa/isort - rev: 5.13.2 + rev: 6.0.1 hooks: - id: isort @@ -100,7 +100,7 @@ repos: - prettier@3.2.5 - repo: https://github.com/psf/black.git - rev: 24.10.0 + rev: 25.1.0 hooks: - id: black files: (.*\.py)$ @@ -114,7 +114,7 @@ repos: - black==24.10.0 - repo: https://github.com/codespell-project/codespell - rev: v2.3.0 + rev: v2.4.1 hooks: - id: codespell args: [-w] @@ -122,7 +122,7 @@ repos: - tomli - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.8.6 + rev: v0.11.4 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix, --no-cache] diff --git a/ChatQnA/chatqna.py b/ChatQnA/chatqna.py index 49f2d3017..0c5810b11 100644 --- a/ChatQnA/chatqna.py +++ b/ChatQnA/chatqna.py @@ -25,7 +25,7 @@ class ChatTemplate: @staticmethod def generate_rag_prompt(question, documents): context_str = "\n".join(documents) - if context_str and len(re.findall("[\u4E00-\u9FFF]", context_str)) / len(context_str) >= 0.3: + if context_str and len(re.findall("[\u4e00-\u9fff]", context_str)) / len(context_str) >= 0.3: # chinese context template = """ ### 你将扮演一个乐于助人、尊重他人并诚实的助手,你的目标是帮助用户解答问题。有效地利用来自本地知识库的搜索结果。确保你的回答中只包含相关信息。如果你不确定问题的答案,请避免分享不准确的信息。 diff --git a/GraphRAG/graphrag.py b/GraphRAG/graphrag.py index 6433e410a..77a912418 100644 --- a/GraphRAG/graphrag.py +++ b/GraphRAG/graphrag.py @@ -26,7 +26,7 @@ class ChatTemplate: @staticmethod def generate_rag_prompt(question, documents): context_str = "\n".join(documents) - if context_str and len(re.findall("[\u4E00-\u9FFF]", context_str)) / len(context_str) >= 0.3: + if context_str and len(re.findall("[\u4e00-\u9fff]", context_str)) / len(context_str) >= 0.3: # chinese context template = """ ### 你将扮演一个乐于助人、尊重他人并诚实的助手,你的目标是帮助用户解答问题。有效地利用来自本地知识库的搜索结果。确保你的回答中只包含相关信息。如果你不确定问题的答案,请避免分享不准确的信息。