From 6f3b6a5d12578226237d8e2cf3360e64bb2f71f9 Mon Sep 17 00:00:00 2001 From: kkscilife <126147887+kkscilife@users.noreply.github.com> Date: Fri, 16 May 2025 14:34:57 +0800 Subject: [PATCH] [CI] Add gitleaks check (#2101) --- .pre-commit-config-zh-cn.yaml | 8 +++++++- .pre-commit-config.yaml | 8 +++++++- opencompass/models/glm.py | 2 +- opencompass/models/interntrain.py | 2 +- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config-zh-cn.yaml b/.pre-commit-config-zh-cn.yaml index 20a7d30c..14ac1a71 100644 --- a/.pre-commit-config-zh-cn.yaml +++ b/.pre-commit-config-zh-cn.yaml @@ -115,9 +115,15 @@ repos: args: - --root_folder - opencompass/configs/datasets + - repo: https://github.com/gitleaks/gitleaks + rev: v8.23.1 + hooks: + - id: gitleaks + entry: "gitleaks dir" + args: ["--verbose", "--redact=50"] # - repo: https://github.com/open-mmlab/pre-commit-hooks # rev: v0.2.0 # Use the ref you want to point at # hooks: # - id: check-algo-readme # - id: check-copyright - # args: ["mmocr", "tests", "tools"] # these directories will be checked \ No newline at end of file + # args: ["mmocr", "tests", "tools"] # these directories will be checked diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 55eb17ea..69941d1b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -116,9 +116,15 @@ repos: args: - --root_folder - opencompass/configs/datasets + - repo: https://github.com/gitleaks/gitleaks + rev: v8.23.1 + hooks: + - id: gitleaks + entry: "gitleaks dir" + args: ["--verbose", "--redact=50"] # - repo: https://github.com/open-mmlab/pre-commit-hooks # rev: v0.2.0 # Use the ref you want to point at # hooks: # - id: check-algo-readme # - id: check-copyright - # args: ["mmocr", "tests", "tools"] # these directories will be checked \ No newline at end of file + # args: ["mmocr", "tests", "tools"] # these directories will be checked diff --git a/opencompass/models/glm.py b/opencompass/models/glm.py index c7882946..27c9d032 100644 --- a/opencompass/models/glm.py +++ b/opencompass/models/glm.py @@ -75,7 +75,7 @@ class GLM130B(BaseModel): ['--vocab-size', '150528'], ['--num-attention-heads', '96'], ['--max-sequence-length', '2048'], - ['--tokenizer-type', 'icetk-glm-130B'], + ['--tokenizer-type', 'icetk-glm-130B'], #gitleaks:allow ['--layernorm-order', 'post'], ['--load', self.ckpt_path], ['--skip-init'], diff --git a/opencompass/models/interntrain.py b/opencompass/models/interntrain.py index 31cdba1d..1a9d0657 100644 --- a/opencompass/models/interntrain.py +++ b/opencompass/models/interntrain.py @@ -358,7 +358,7 @@ class InternTrain(BaseModel): output_text = self.batch_decode( outputs, eos_token_ids=self.generator.eos_token_id, - stopping_criteria=stopping_criteria) + stopping_criteria=stopping_criteria) #gitleaks:allow return output_text