Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#1446)
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] authored Apr 9, 2024
1 parent a00a6f2 commit d1fdcdd
Show file tree
Hide file tree
Showing 730 changed files with 6,634 additions and 1,702 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/script/models/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def main():


def parse_tuning_log(line, url_dict):
"""Parsing {Framework}-{Model}-tune.log to get tuning result"""
"""Parsing {Framework}-{Model}-tune.log to get tuning result."""
result = line.split(";")
OS, Platform, Framework, Version, Model, Strategy, Tune_time, Tuning_trials, URL, __ = result
file_name = f"{Framework}-{Model}-tune.log"
Expand All @@ -57,7 +57,7 @@ def parse_tuning_log(line, url_dict):


def parse_summary_log(line, url_dict):
"""Parse {Framework}-{Model}-tune.log to get benchmarking accuracy result"""
"""Parse {Framework}-{Model}-tune.log to get benchmarking accuracy result."""
result = line.split(";")
OS, Platform, Framework, Version, Precision, Model, Mode, Type, BS, Value, Url = result
file_name = f"{Framework}-{Model}-tune.log"
Expand Down
174 changes: 106 additions & 68 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,10 @@ repos:
rev: v2.2.6
hooks:
- id: codespell
args:
[-w, --ignore-words=.github/workflows/script/formatScan/nlp_dict.txt]
args: [-w, --ignore-words=.github/workflows/script/formatScan/nlp_dict.txt]
exclude: |
(?x)^(
.+.po|.+.ts|.+.js|.+.map|.+.js.map|.+.css.map|
.+.po|.+.map|.+.js.map|.+.css.map|
.github/workflows/script/formatScan/nlp_dict.txt|
docker/third_party_programs_docker.txt|
intel_extension_for_transformers/transformers/llm/evaluation/hf_eval/datasets/cnn_validation.json|
Expand All @@ -61,14 +60,12 @@ repos:
)$
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.4
rev: v1.5.5
hooks:
- id: insert-license
files: |
(?x)^(
intel_extension_for_transformers/.*(py|yaml|yml|sh)|
workflows/.*(py|yaml|yml|sh)|
tests/.*(py|yaml|yml|sh)
(intel_extension_for_transformers|workflows|tests)/.*(py|yaml|yml|sh)
)$
args:
[
Expand All @@ -77,64 +74,105 @@ repos:
--detect-license-in-X-top-lines=40,
--skip-license-insertion-comment=Copyright,
]
# - repo: https://github.com/asottile/yesqa
# rev: v1.5.0
# hooks:
# - id: yesqa
# name: Unused noqa
#
# - repo: https://github.com/pycqa/isort
# rev: 5.13.2
# hooks:
# - id: isort
# exclude: |
# (?x)^(
# examples/.+
# )$
#
# - repo: https://github.com/PyCQA/docformatter
# rev: v1.7.5
# hooks:
# - id: docformatter
# args: [
# --in-place,
# --wrap-summaries=0, # 0 means disable wrap
# --wrap-descriptions=0, # 0 means disable wrap
# --black,
# --style=google,
# ]
# exclude: |
# (?x)^(
# examples/.+
# )$
#
# - repo: https://github.com/psf/black.git
# rev: 23.12.1
# hooks:
# - id: black
# files: (.*\.py)$
# exclude: |
# (?x)^(
# examples/.+
# )$
#
# - repo: https://github.com/asottile/blacken-docs
# rev: 1.16.0
# hooks:
# - id: blacken-docs
# args: [--line-length=120, --skip-errors]
# exclude: |
# (?x)^(
# examples/.+|
# docs/source-app
# )$
#
# - repo: https://github.com/astral-sh/ruff-pre-commit
# rev: v0.1.9
# hooks:
# - id: ruff
# args: [--fix, --exit-non-zero-on-fix, --no-cache]
# exclude: |
# (?x)^(
# examples/.+
# )$
- id: insert-license
files: |
(?x)^(
(intel_extension_for_transformers|workflows|tests)/.*(ts|js|cpp|hpp)
)$
args:
[
--license-filepath=.github/license_template.txt,
--use-current-year,
--detect-license-in-X-top-lines=40,
--skip-license-insertion-comment=Copyright,
--comment-style=//,
]
- id: insert-license
files: |
(?x)^(
(intel_extension_for_transformers|workflows|tests)/.*(html|svelte)
)$
args:
[
--license-filepath=.github/license_template.txt,
--use-current-year,
--detect-license-in-X-top-lines=40,
--skip-license-insertion-comment=Copyright,
--comment-style=<!--| |-->,
]

- repo: https://github.com/asottile/yesqa
rev: v1.5.0
hooks:
- id: yesqa
name: Unused noqa

# - repo: https://github.com/pycqa/isort
# rev: 5.13.2
# hooks:
# - id: isort
# args: [--profile=black, --line-length=120]
# exclude: |
# (?x)^(
# examples/.+|
# .*\__init__.py
# )$

# - repo: https://github.com/pre-commit/mirrors-prettier
# rev: "v4.0.0-alpha.8" # Use the sha / tag you want to point at
# hooks:
# - id: prettier
# args: [--print-width=120]
# types_or: [yaml, html, css, scss, javascript, json, ts]
# additional_dependencies:
# - [email protected]

- repo: https://github.com/PyCQA/docformatter
rev: v1.7.5
hooks:
- id: docformatter
args: [
--in-place,
--wrap-summaries=0, # 0 means disable wrap
--wrap-descriptions=0, # 0 means disable wrap
--black,
--style=google,
]
exclude: |
(?x)^(
examples/.+
)$
# - repo: https://github.com/psf/black.git
# rev: 24.3.0
# hooks:
# - id: black
# files: (.*\.py)$
# args: [--line-length=120]
# exclude: |
# (?x)^(
# examples/.+
# )$

# - repo: https://github.com/asottile/blacken-docs
# rev: 1.16.0
# hooks:
# - id: blacken-docs
# args: [--line-length=120, --skip-errors]
# additional_dependencies:
# - black==24.3.0
# exclude: |
# (?x)^(
# examples/.+|
# docs/source-app
# )$

# - repo: https://github.com/astral-sh/ruff-pre-commit
# rev: v0.3.5
# hooks:
# - id: ruff
# args: [--fix, --exit-non-zero-on-fix, --no-cache]
# exclude: |
# (?x)^(
# examples/.+
# )$
88 changes: 88 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".ipynb_checkpoints",
".mypy_cache",
".nox",
".pants.d",
".pyenv",
".pytest_cache",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
".vscode",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"site-packages",
"venv",
]

# Same as Black.
line-length = 120
indent-width = 4

# Assume Python 3.10
target-version = "py310"

[lint]
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
# McCabe complexity (`C901`) by default.
select = ["E4", "E7", "E9", "F"]
ignore = [
"E402", # Module level import not at top of file
"E501", # Line too long (121 > 120 characters)
"E721", # Do not compare types, use isinstance()
"E722", # Do not use bare except
"E731", # Do not assign a lambda expression, use a def
"E741", # Do not use variables named ‘l’, ‘O’, or ‘I’
"F401", # {name} imported but unused
"F403", # from {name} import * used; unable to detect undefined names
"F405", # {name} may be undefined, or defined from star imports
"F841", # Local variable is assigned to but never used{name}
]

# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []

# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

[format]
# Like Black, use double quotes for strings.
quote-style = "double"

# Like Black, indent with spaces, rather than tabs.
indent-style = "space"

# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false

# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"

# Enable auto-formatting of code examples in docstrings. Markdown,
# reStructuredText code/literal blocks and doctests are all supported.
#
# This is currently disabled by default, but it is planned for this
# to be opt-out in the future.
docstring-code-format = false

# Set the line length limit used when formatting code snippets in
# docstrings.
#
# This only has an effect when the `docstring-code-format` setting is
# enabled.
docstring-code-line-length = "dynamic"
3 changes: 1 addition & 2 deletions docs/tutorials/pytorch/question-answering/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,7 @@ def postprocess_qa_predictions(
prefix: Optional[str] = None,
log_level: Optional[int] = logging.WARNING,
):
"""
Post-processes the predictions of a question-answering model to convert them to answers that are substrings of the
"""Post-processes the predictions of a question-answering model to convert them to answers that are substrings of the
original contexts. This is the base postprocessing functions for models that only return start and end logits.
Args:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

""" BERT model configuration for SWEET"""
"""BERT model configuration for SWEET."""

from collections import OrderedDict
from typing import Mapping
Expand Down
Loading

0 comments on commit d1fdcdd

Please sign in to comment.