[pre-commit.ci] pre-commit autoupdate (#1771)
Signed-off-by: Sun, Xuehao <xuehao.sun@intel.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Sun, Xuehao <xuehao.sun@intel.com> Co-authored-by: Abolfazl Shahbazi <12436063+ashahba@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
398441a10c
commit
094ca7aefe
@@ -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]
|
||||
|
||||
@@ -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 = """
|
||||
### 你将扮演一个乐于助人、尊重他人并诚实的助手,你的目标是帮助用户解答问题。有效地利用来自本地知识库的搜索结果。确保你的回答中只包含相关信息。如果你不确定问题的答案,请避免分享不准确的信息。
|
||||
|
||||
@@ -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 = """
|
||||
### 你将扮演一个乐于助人、尊重他人并诚实的助手,你的目标是帮助用户解答问题。有效地利用来自本地知识库的搜索结果。确保你的回答中只包含相关信息。如果你不确定问题的答案,请避免分享不准确的信息。
|
||||
|
||||
Reference in New Issue
Block a user