Skip to content

Commit 26e08d1

Browse files
committed
fix quantization tests
1 parent 40f3dac commit 26e08d1

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

tests/openvino/test_exporters_cli.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,11 @@ def test_exporters_cli_full_quantization(
425425

426426
submodels = []
427427
if task == "automatic-speech-recognition":
428-
submodels = [model.encoder, model.decoder, model.decoder_with_past]
428+
submodels = [model.encoder, model.decoder]
429+
if model.decoder_with_past is not None:
430+
submodels.append(model.decoder_with_past)
431+
else:
432+
expected_num_fq_nodes_per_model = expected_num_fq_nodes_per_model[:-1]
429433
self.assertEqual(len(expected_num_fq_nodes_per_model), len(submodels))
430434
for i, model in enumerate(submodels):
431435
actual_num_fq_nodes, actual_num_weight_nodes = get_num_quantized_nodes(model)

tests/openvino/test_quantization.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class OVQuantizerTest(unittest.TestCase):
111111
weight_only=False,
112112
smooth_quant_alpha=0.95,
113113
),
114-
(14, 22, 21) if is_transformers_version("<=", "4.42.4") else (14, 26, 25),
114+
(14, 22, 21) if is_transformers_version("<=", "4.42.4") else (14, 22, 25),
115115
(14, 21, 17) if is_transformers_version("<=", "4.42.4") else (14, 22, 18),
116116
),
117117
]

0 commit comments

Comments
 (0)