diff --git a/optimum/onnxruntime/modeling_decoder.py b/optimum/onnxruntime/modeling_decoder.py index 26b693b4e05..30adbf14f1f 100644 --- a/optimum/onnxruntime/modeling_decoder.py +++ b/optimum/onnxruntime/modeling_decoder.py @@ -1036,6 +1036,7 @@ def _from_transformers( task=task, do_validation=False, no_post_process=False, + legacy=False, subfolder=subfolder, revision=revision, cache_dir=cache_dir, diff --git a/tests/onnxruntime/test_modeling.py b/tests/onnxruntime/test_modeling.py index 3269d3db3d6..218d94eda23 100644 --- a/tests/onnxruntime/test_modeling.py +++ b/tests/onnxruntime/test_modeling.py @@ -2049,7 +2049,7 @@ def test_merge_from_onnx_and_save(self, model_arch): self.skipTest("Unsupported export case") with tempfile.TemporaryDirectory() as tmpdir: - main_export(model_id, tmpdir, task=task) + main_export(model_id, tmpdir, task=task, legacy=True) model = ORTModelForCausalLM.from_pretrained(tmpdir)