Skip to content

Commit e947742

Browse files
authored
Fixed issues with diffusers patching. Use separate PEP8 config for WWB (openvinotoolkit#1113)
1 parent cb2d527 commit e947742

File tree

3 files changed

+45
-15
lines changed

3 files changed

+45
-15
lines changed

.github/workflows/llm_bench-python.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
run: |
5050
# stop the build if there are Python syntax errors or undefined names
5151
python -m flake8 ${{ env.LLM_BENCH_PYPATH }} --config=${{ env.LLM_BENCH_PYPATH }}/setup.cfg
52-
python -m flake8 ${{ env.WWB_PATH }} --config=${{ env.LLM_BENCH_PYPATH }}/setup.cfg
52+
python -m flake8 ${{ env.WWB_PATH }} --config=${{ env.WWB_PATH }}/setup.cfg
5353
- name: Create code style diff for samples
5454
if: failure()
5555
run: |

tools/who_what_benchmark/setup.cfg

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[flake8]
2+
# ignore:
3+
# D100 - Missing docstring in public module
4+
# D101 - Missing docstring in public class
5+
# D103 - Missing docstring in public function
6+
# VNE001 - Single letter variable names are not allowed
7+
# W503 - https://www.flake8rules.com/rules/W503.html conflicts with W504
8+
filename = *.py
9+
max-line-length = 160
10+
ignore = E203,D100,D101,D103,VNE001,W503
11+
max-parameters-amount = 8
12+
show_source = True
13+
docstring-convention = google
14+
enable-extensions = G
15+
per-file-ignores =
16+
# imports order
17+
tools/who_what_benchmark/whowhatbench/wwb.py: E402
18+
19+
[pydocstyle]
20+
convention = google
21+
22+
[mypy]
23+
ignore_missing_imports = True
24+
disable_error_code = attr-defined
25+
show_column_numbers = True
26+
show_error_context = True
27+
show_absolute_path = True
28+
pretty = True

tools/who_what_benchmark/whowhatbench/wwb.py

+16-14
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
1-
from whowhatbench import EVALUATOR_REGISTRY, MODELTYPE2TASK
2-
import openvino_genai
3-
from optimum.intel import OVPipelineForText2Image
4-
from optimum.exporters.tasks import TasksManager
5-
from transformers import AutoConfig, AutoTokenizer, AutoModelForCausalLM
6-
from optimum.utils import NormalizedConfigManager, NormalizedTextConfig
7-
from optimum.intel.openvino import OVModelForCausalLM
8-
from diffusers import DiffusionPipeline
9-
from datasets import load_dataset
1+
from .utils import patch_diffusers
2+
3+
patch_diffusers()
4+
105
import argparse
116
import difflib
12-
import os
137
import json
14-
import pandas as pd
15-
from PIL import Image
168
import logging
9+
import os
1710

18-
from .utils import patch_diffusers
19-
patch_diffusers()
11+
import openvino_genai
12+
import pandas as pd
13+
from datasets import load_dataset
14+
from diffusers import DiffusionPipeline
15+
from optimum.exporters.tasks import TasksManager
16+
from optimum.intel import OVPipelineForText2Image
17+
from optimum.intel.openvino import OVModelForCausalLM
18+
from optimum.utils import NormalizedConfigManager, NormalizedTextConfig
19+
from PIL import Image
20+
from transformers import AutoConfig, AutoModelForCausalLM, AutoTokenizer
2021

22+
from whowhatbench import EVALUATOR_REGISTRY, MODELTYPE2TASK
2123

2224
# Configure logging
2325
logging.basicConfig(level=logging.INFO)

0 commit comments

Comments
 (0)