Unverified Commit 8b163bd8 authored by Tong Gao's avatar Tong Gao Committed by GitHub
Browse files

[Feature] Several enhancements (#142)

parent c00179d4
exclude: |
(?x)^(
tests/data/|
opencompass/models/internal/|
opencompass/utils/internal/|
configs/
)
repos:
- repo: https://gitee.com/openmmlab/mirrors-flake8
rev: 5.0.4
hooks:
- id: flake8
- repo: https://gitee.com/openmmlab/mirrors-isort
rev: 5.11.5
hooks:
- id: isort
- repo: https://gitee.com/openmmlab/mirrors-yapf
rev: v0.32.0
hooks:
- id: yapf
- repo: https://gitee.com/openmmlab/mirrors-codespell
rev: v2.2.1
hooks:
- id: codespell
- repo: https://gitee.com/openmmlab/mirrors-pre-commit-hooks
rev: v4.3.0
hooks:
- id: trailing-whitespace
exclude: |
(?x)^(
dicts/|
projects/.*?/dicts/
)
- id: check-yaml
- id: end-of-file-fixer
exclude: |
(?x)^(
dicts/|
projects/.*?/dicts/
)
- id: requirements-txt-fixer
- id: double-quote-string-fixer
- id: check-merge-conflict
- id: fix-encoding-pragma
args: ["--remove"]
- id: mixed-line-ending
args: ["--fix=lf"]
- id: mixed-line-ending
args: ["--fix=lf"]
- repo: https://gitee.com/openmmlab/mirrors-mdformat
rev: 0.7.9
hooks:
- id: mdformat
args: ["--number", "--table-width", "200"]
additional_dependencies:
- mdformat-openmmlab
- mdformat_frontmatter
- linkify-it-py
- repo: https://gitee.com/openmmlab/mirrors-docformatter
rev: v1.3.1
hooks:
- id: docformatter
args: ["--in-place", "--wrap-descriptions", "79"]
# - 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
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
import itertools import itertools
import os import os
from functools import partial
from typing import List, Optional from typing import List, Optional
import torch.nn.functional as F import torch.nn.functional as F
...@@ -127,9 +126,6 @@ class CLPInferencer(BaseInferencer): ...@@ -127,9 +126,6 @@ class CLPInferencer(BaseInferencer):
# in case tokenizer returns list for single token # in case tokenizer returns list for single token
choice_ids = list(itertools.chain(*choice_ids)) choice_ids = list(itertools.chain(*choice_ids))
get_token_len = partial(
self.model.get_token_len, # COPYBARA_INTERNAL # noqa
eos=False) # COPYBARA_INTERNAL # noqa
get_token_len = self.model.get_token_len get_token_len = self.model.get_token_len
# prepare in context for each example and control the length # prepare in context for each example and control the length
......
import argparse
import json import json
from typing import Dict, List, Optional, Union from typing import Dict, List, Optional, Union
...@@ -37,3 +38,21 @@ class LarkReporter: ...@@ -37,3 +38,21 @@ class LarkReporter:
} }
} }
requests.post(self.url, data=json.dumps(msg)) requests.post(self.url, data=json.dumps(msg))
def parse_args():
parser = argparse.ArgumentParser(description='Lark bot reporter')
parser.add_argument('url', help='Lark bot url')
parser.add_argument('content', type=str, help='Content')
parser.add_argument('--title', type=str, help='Title', default=None)
args = parser.parse_args()
return args
if __name__ == '__main__':
args = parse_args()
lark = LarkReporter(args.url)
if args.title:
lark.post(args.content, args.title)
else:
lark.post(args.content)
absl-py
accelerate>=0.19.0 accelerate>=0.19.0
boto3 boto3
colossalai colossalai
...@@ -14,6 +15,7 @@ openai ...@@ -14,6 +15,7 @@ openai
pandas<2.0.0 pandas<2.0.0
rank_bm25==0.2.2 rank_bm25==0.2.2
requests==2.28.1 requests==2.28.1
rouge_score
scikit_learn==1.2.1 scikit_learn==1.2.1
sentence_transformers==2.2.2 sentence_transformers==2.2.2
tabulate tabulate
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment