Add benchmark_util for transformers >= 4.47.0 (#12644)
				
					
				
			This commit is contained in:
		
							parent
							
								
									550fa01649
								
							
						
					
					
						commit
						8fd2dcba86
					
				
					 4 changed files with 4910 additions and 7 deletions
				
			
		| 
						 | 
				
			
			@ -32,10 +32,7 @@ current_dir = os.path.dirname(os.path.realpath(__file__))
 | 
			
		|||
import sys
 | 
			
		||||
sys.stdout.reconfigure(encoding='utf-8')
 | 
			
		||||
 | 
			
		||||
try:
 | 
			
		||||
from ipex_llm.utils import BenchmarkWrapper
 | 
			
		||||
except:
 | 
			
		||||
    pass
 | 
			
		||||
from ipex_llm.utils.common.log4Error import invalidInputError
 | 
			
		||||
from ipex_llm.utils.common import invalidInputError
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -23,8 +23,7 @@ import transformers
 | 
			
		|||
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":
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										4907
									
								
								python/llm/src/ipex_llm/utils/benchmark_util_4_47.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4907
									
								
								python/llm/src/ipex_llm/utils/benchmark_util_4_47.py
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							
		Loading…
	
		Reference in a new issue