Skip to content

Commit

Permalink
Add benchmark_util for transformers >= 4.47.0 (#12644)
Browse files Browse the repository at this point in the history
  • Loading branch information
lzivan authored Jan 3, 2025
1 parent 550fa01 commit 8fd2dcb
Show file tree
Hide file tree
Showing 4 changed files with 4,910 additions and 7 deletions.
5 changes: 1 addition & 4 deletions python/llm/dev/benchmark/all-in-one/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@
import sys
sys.stdout.reconfigure(encoding='utf-8')

try:
from ipex_llm.utils import BenchmarkWrapper
except:
pass
from ipex_llm.utils import BenchmarkWrapper
from ipex_llm.utils.common.log4Error import invalidInputError
from ipex_llm.utils.common import invalidInputError

Expand Down
2 changes: 1 addition & 1 deletion python/llm/dev/test/lint-python
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
PYTHON_ROOT_DIR="$SCRIPT_DIR/.."
echo $PYTHON_ROOT_DIR
PATHS_TO_CHECK="$SCRIPT_DIR/../../src"
PATTERNS_TO_EXCLUDE="__init__.py,log4Error.py,$SCRIPT_DIR/../../src/ipex_llm/langchain/*,$SCRIPT_DIR/../../src/ipex_llm/transformers/gguf/models/model_implement/yuan2/*,benchmark_util_4_29.py,benchmark_util_4_42.py,benchmark_util_4_43.py,benchmark_util_4_44.py,benchmark_util_4_45.py,tgi_api_server.py,api_server.py"
PATTERNS_TO_EXCLUDE="__init__.py,log4Error.py,$SCRIPT_DIR/../../src/ipex_llm/langchain/*,$SCRIPT_DIR/../../src/ipex_llm/transformers/gguf/models/model_implement/yuan2/*,benchmark_util_4_29.py,benchmark_util_4_42.py,benchmark_util_4_43.py,benchmark_util_4_44.py,benchmark_util_4_45.py,benchmark_util_4_47.py,tgi_api_server.py,api_server.py"
PEP8_REPORT_PATH="$PYTHON_ROOT_DIR/test/pep8-report.txt"
PYLINT_REPORT_PATH="$PYTHON_ROOT_DIR/test/pylint-report.txt"
PYLINT_INSTALL_INFO="$PYTHON_ROOT_DIR/test/pylint-info.txt"
Expand Down
3 changes: 1 addition & 2 deletions python/llm/src/ipex_llm/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
trans_version = transformers.__version__

if trans_version >= "4.47.0":
# TODO
pass
from .benchmark_util_4_47 import BenchmarkWrapper
elif trans_version >= "4.45.0":
from .benchmark_util_4_45 import BenchmarkWrapper
elif trans_version >= "4.44.0":
Expand Down
Loading

0 comments on commit 8fd2dcb

Please sign in to comment.