Skip to content

Commit

Permalink
update install_python_deps
Browse files Browse the repository at this point in the history
  • Loading branch information
jchen351 committed Jun 19, 2024
1 parent 0f1dc32 commit ae3ace1
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions tools/ci_build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -870,8 +870,7 @@ def update_submodules(source_dir):
run_subprocess(["git", "submodule", "update", "--init", "--recursive"], cwd=source_dir)


def install_python_deps(numpy_version=""):
requirements_file = 'requirements-pybind.txt'
def install_python_deps(requirements_file='requirements.txt',numpy_version=""):
if numpy_version:
# Remove current numpy version from requirements-pybind.txt and add the specified version
with open(requirements_file, 'r+') as file:
Expand Down Expand Up @@ -2154,10 +2153,7 @@ def run_onnxruntime_tests(args, source_dir, ctest_path, build_dir, configs):

numpy_init_version = numpy.__version__
pb_init_version = google.protobuf.__version__
run_subprocess(
[sys.executable, "-m", "pip", "install", "-r", "requirements-transformers-test.txt"],
cwd=SCRIPT_DIR,
)
install_python_deps('requirements-transformers-test.txt')
run_subprocess([sys.executable, "-m", "pytest", "transformers"], cwd=cwd)
# Restore initial numpy/protobuf version in case other tests use it
run_subprocess([sys.executable, "-m", "pip", "install", "numpy==" + numpy_init_version])
Expand Down Expand Up @@ -2818,7 +2814,7 @@ def main():
run_subprocess([emsdk_file, "activate", emsdk_version], cwd=emsdk_dir)

if args.enable_pybind and is_windows():
install_python_deps(args.numpy_version)
install_python_deps('requirements-pybind.txt',args.numpy_version)

if args.use_rocm and args.rocm_version is None:
args.rocm_version = ""
Expand Down

0 comments on commit ae3ace1

Please sign in to comment.