Skip to content

Commit 70f5811

Browse files
committed
unpatch for onnx
1 parent 319f610 commit 70f5811

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

optimum/exporters/openvino/convert.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,12 @@ def ts_patched_forward(*args, **kwargs):
385385
"A stateless model will be exported instead. It may result in sub-optimal inference performance."
386386
"Provide a model that can be converted to OpenVINO without fallback to ONNX conversion path."
387387
)
388+
389+
if patch_16bit_model:
390+
from openvino.frontend.pytorch.patch_model import unpatch_model
391+
unpatch_model(model, "_openvino_module_extension_patch_orig_forward")
392+
model.to(torch.float32)
393+
388394
return export_pytorch_via_onnx(
389395
model,
390396
config,

0 commit comments

Comments
 (0)