From 590f993ed63f6349620b68ee21857f9fcd33877e Mon Sep 17 00:00:00 2001 From: Ella Charlaix Date: Thu, 21 Sep 2023 16:45:33 +0200 Subject: [PATCH] skip test --- tests/cli/test_cli.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tests/cli/test_cli.py b/tests/cli/test_cli.py index 7e94d58db7b..147c0bd258f 100644 --- a/tests/cli/test_cli.py +++ b/tests/cli/test_cli.py @@ -21,6 +21,9 @@ import unittest from pathlib import Path +from onnxruntime import __version__ as ort_version +from packaging.version import Version, parse + import optimum.commands @@ -84,14 +87,22 @@ def test_quantize_commands(self): export_commands = [ f"optimum-cli export onnx --model hf-internal-testing/tiny-random-BertModel {tempdir}/encoder", f"optimum-cli export onnx --model hf-internal-testing/tiny-random-gpt2 {tempdir}/decoder", - f"optimum-cli export onnx --model hf-internal-testing/tiny-random-t5 {tempdir}/encoder-decoder", + # f"optimum-cli export onnx --model hf-internal-testing/tiny-random-t5 {tempdir}/encoder-decoder", ] quantize_commands = [ f"optimum-cli onnxruntime quantize --onnx_model {tempdir}/encoder --avx2 -o {tempdir}/quantized_encoder", f"optimum-cli onnxruntime quantize --onnx_model {tempdir}/decoder --avx2 -o {tempdir}/quantized_decoder", - f"optimum-cli onnxruntime quantize --onnx_model {tempdir}/encoder-decoder --avx2 -o {tempdir}/quantized_encoder_decoder", + # f"optimum-cli onnxruntime quantize --onnx_model {tempdir}/encoder-decoder --avx2 -o {tempdir}/quantized_encoder_decoder", ] + if parse(ort_version) != Version("1.16.0"): + export_commands.append( + f"optimum-cli export onnx --model hf-internal-testing/tiny-random-t5 {tempdir}/encoder-decoder" + ) + quantize_commands.append( + f"optimum-cli onnxruntime quantize --onnx_model {tempdir}/encoder-decoder --avx2 -o {tempdir}/quantized_encoder_decoder" + ) + for export, quantize in zip(export_commands, quantize_commands): subprocess.run(export, shell=True, check=True) subprocess.run(quantize, shell=True, check=True)