diff --git a/tools/ci_build/build.py b/tools/ci_build/build.py index 9f92205c53..48ee7a0160 100755 --- a/tools/ci_build/build.py +++ b/tools/ci_build/build.py @@ -209,8 +209,8 @@ def download_test_data(build_dir, src_url, expected_md5, azure_sas_key): elif shutil.which('curl'): subprocess.run(['curl', '-s', src_url, '-o', local_zip_file], check=True) else: - log.error("No downloading tool for use") - return False + import urllib.request + urllib.request.urlretrieve(src_url, local_zip_file) models_dir = os.path.join(build_dir,'models') if os.path.exists(models_dir): log.info('deleting %s' % models_dir) @@ -226,7 +226,9 @@ def download_test_data(build_dir, src_url, expected_md5, azure_sas_key): return True def generate_build_tree(cmake_path, source_dir, build_dir, cuda_home, cudnn_home, pb_home, configs, cmake_extra_defines, args, cmake_extra_args): - has_test_data = download_test_data(build_dir, test_data_url, test_data_checksum, args.azure_sas_key) + has_test_data = False + if args.enable_onnx_tests: + has_test_data = download_test_data(build_dir, test_data_url, test_data_checksum, args.azure_sas_key) #create a shortcut for test models if there is a 'models' folder in build_dir if has_test_data and is_windows(): src_model_dir = os.path.join(build_dir, 'models')