24
24
from transformers .models .roberta import RobertaOnnxConfig
25
25
from transformers .models .t5 import T5OnnxConfig
26
26
from transformers .models .xlm_roberta import XLMRobertaOnnxConfig
27
- from transformers .onnx import EXTERNAL_DATA_FORMAT_SIZE_LIMIT , OnnxConfig , ParameterFormat
27
+ from transformers .onnx import EXTERNAL_DATA_FORMAT_SIZE_LIMIT , OnnxConfig , ParameterFormat , validate_model_outputs
28
28
from transformers .onnx .config import DEFAULT_ONNX_OPSET , OnnxConfigWithPast
29
- from transformers .onnx .convert import validate_model_outputs
30
29
from transformers .onnx .utils import (
31
30
compute_effective_axis_dimension ,
32
31
compute_serialized_parameters_size ,
@@ -204,7 +203,7 @@ class OnnxExportTestCaseV2(TestCase):
204
203
@slow
205
204
@require_torch
206
205
def test_pytorch_export_default (self ):
207
- from transformers .onnx . convert import convert_pytorch
206
+ from transformers .onnx import export
208
207
209
208
for name , model , model_class , config_class , onnx_config_class in PYTORCH_EXPORT_DEFAULT_MODELS :
210
209
with self .subTest (name ):
@@ -215,7 +214,7 @@ def test_pytorch_export_default(self):
215
214
onnx_config = onnx_config_class .default (model .config )
216
215
217
216
with NamedTemporaryFile ("w" ) as output :
218
- onnx_inputs , onnx_outputs = convert_pytorch (
217
+ onnx_inputs , onnx_outputs = export (
219
218
tokenizer , model , onnx_config , DEFAULT_ONNX_OPSET , Path (output .name )
220
219
)
221
220
@@ -227,7 +226,7 @@ def test_pytorch_export_default(self):
227
226
@slow
228
227
@require_torch
229
228
def test_pytorch_export_with_past (self ):
230
- from transformers .onnx . convert import convert_pytorch
229
+ from transformers .onnx import export
231
230
232
231
for name , model , model_class , config_class , onnx_config_class in PYTORCH_EXPORT_WITH_PAST_MODELS :
233
232
with self .subTest (name ):
@@ -244,7 +243,7 @@ def test_pytorch_export_with_past(self):
244
243
245
244
with NamedTemporaryFile ("w" ) as output :
246
245
output = Path (output .name )
247
- onnx_inputs , onnx_outputs = convert_pytorch (
246
+ onnx_inputs , onnx_outputs = export (
248
247
tokenizer , model , onnx_config , DEFAULT_ONNX_OPSET , output
249
248
)
250
249
0 commit comments