mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-07 17:15:29 +00:00
transformers test CI pipeline fix (#8016)
* init checkin * Restore initial environment * -y * testtest * fix * fix indent
This commit is contained in:
parent
43c45ddd66
commit
e6225c62a5
2 changed files with 17 additions and 4 deletions
|
|
@ -1516,11 +1516,16 @@ def run_onnxruntime_tests(args, source_dir, ctest_path, build_dir, configs):
|
|||
run_subprocess([sys.executable, '-m', 'unittest', 'discover', '-s', 'quantization'],
|
||||
cwd=cwd, dll_path=dll_path)
|
||||
if args.enable_transformers_tool_test:
|
||||
required = {
|
||||
'numpy==1.19.2', 'coloredlogs==15.0', 'tf2onnx==1.8.5', 'transformers==4.6.1',
|
||||
'torch==1.8.1', 'tensorflow==2.5.0', 'onnxconverter-common==1.8.1', 'psutil'}
|
||||
run_subprocess([sys.executable, '-m', 'pip', 'install', *required])
|
||||
import numpy
|
||||
numpy_init_version = numpy.__version__
|
||||
run_subprocess([sys.executable, '-m', 'pip', 'install', '-r', 'requirements.txt'],
|
||||
cwd=SCRIPT_DIR)
|
||||
run_subprocess([sys.executable, '-m', 'pytest', 'transformers'], cwd=cwd)
|
||||
# Restore initial environment
|
||||
run_subprocess([sys.executable, '-m', 'pip', 'uninstall', '-r', 'requirements.txt', '-y'],
|
||||
cwd=SCRIPT_DIR)
|
||||
# Restore initial numpy version in case other tests use it
|
||||
run_subprocess([sys.executable, '-m', 'pip', 'install', 'numpy==' + numpy_init_version])
|
||||
|
||||
if not args.disable_ml_ops:
|
||||
run_subprocess([sys.executable, 'onnxruntime_test_python_backend_mlops.py'],
|
||||
|
|
|
|||
8
tools/ci_build/requirements.txt
Normal file
8
tools/ci_build/requirements.txt
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
# packages used by transformers tool test
|
||||
|
||||
numpy==1.19.2
|
||||
coloredlogs==15.0
|
||||
transformers==4.6.1
|
||||
torch==1.8.1
|
||||
onnxconverter-common==1.8.1
|
||||
psutil
|
||||
Loading…
Reference in a new issue