Skip to content

Commit 6f3b6a5

Browse files
authored
[CI] Add gitleaks check (#2101)
1 parent 3d1760a commit 6f3b6a5

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

.pre-commit-config-zh-cn.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,15 @@ repos:
115115
args:
116116
- --root_folder
117117
- opencompass/configs/datasets
118+
- repo: https://github.com/gitleaks/gitleaks
119+
rev: v8.23.1
120+
hooks:
121+
- id: gitleaks
122+
entry: "gitleaks dir"
123+
args: ["--verbose", "--redact=50"]
118124
# - repo: https://github.com/open-mmlab/pre-commit-hooks
119125
# rev: v0.2.0 # Use the ref you want to point at
120126
# hooks:
121127
# - id: check-algo-readme
122128
# - id: check-copyright
123-
# args: ["mmocr", "tests", "tools"] # these directories will be checked
129+
# args: ["mmocr", "tests", "tools"] # these directories will be checked

.pre-commit-config.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,15 @@ repos:
116116
args:
117117
- --root_folder
118118
- opencompass/configs/datasets
119+
- repo: https://github.com/gitleaks/gitleaks
120+
rev: v8.23.1
121+
hooks:
122+
- id: gitleaks
123+
entry: "gitleaks dir"
124+
args: ["--verbose", "--redact=50"]
119125
# - repo: https://github.com/open-mmlab/pre-commit-hooks
120126
# rev: v0.2.0 # Use the ref you want to point at
121127
# hooks:
122128
# - id: check-algo-readme
123129
# - id: check-copyright
124-
# args: ["mmocr", "tests", "tools"] # these directories will be checked
130+
# args: ["mmocr", "tests", "tools"] # these directories will be checked

opencompass/models/glm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def _load_model(self, **kwargs):
7575
['--vocab-size', '150528'],
7676
['--num-attention-heads', '96'],
7777
['--max-sequence-length', '2048'],
78-
['--tokenizer-type', 'icetk-glm-130B'],
78+
['--tokenizer-type', 'icetk-glm-130B'], #gitleaks:allow
7979
['--layernorm-order', 'post'],
8080
['--load', self.ckpt_path],
8181
['--skip-init'],

opencompass/models/interntrain.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ def generate(self,
358358
output_text = self.batch_decode(
359359
outputs,
360360
eos_token_ids=self.generator.eos_token_id,
361-
stopping_criteria=stopping_criteria)
361+
stopping_criteria=stopping_criteria) #gitleaks:allow
362362

363363
return output_text
364364

0 commit comments

Comments
 (0)