File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
optimum/exporters/openvino Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -370,11 +370,6 @@ def export_pytorch(
370
370
patcher = config .patch_model_for_export (model , model_kwargs = model_kwargs )
371
371
patched_forward = patcher .patched_forward
372
372
373
- if patch_16bit_model :
374
- from openvino .frontend .pytorch .patch_model import __make_16bit_traceable
375
-
376
- __make_16bit_traceable (model )
377
-
378
373
@functools .wraps (patched_forward )
379
374
def ts_patched_forward (* args , ** kwargs ):
380
375
for i in range (len (dict_inputs )):
@@ -388,6 +383,9 @@ def ts_patched_forward(*args, **kwargs):
388
383
patcher .patched_forward = ts_patched_forward
389
384
390
385
with patcher :
386
+ if patch_16bit_model :
387
+ from openvino .frontend .pytorch .patch_model import __make_16bit_traceable
388
+ __make_16bit_traceable (model )
391
389
check_dummy_inputs_are_allowed (model , dummy_inputs )
392
390
sig = inspect .signature (model .forward ) if hasattr (model , "forward" ) else inspect .signature (model .call )
393
391
inputs = config .ordered_inputs (model )
You can’t perform that action at this time.
0 commit comments