Skip to content

Commit

Permalink
Return the original forward after exporting the PyTorch model to Open…
Browse files Browse the repository at this point in the history
…VINO (#522)
  • Loading branch information
alexsu52 authored Jan 18, 2024
1 parent 76ce9de commit e00c5fc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions optimum/exporters/openvino/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,9 @@ def ts_patched_forward(*args, **kwargs):
compression_option=compression_option,
compression_ratio=compression_ratio,
)
# return original forward
if patch_model_forward:
model.forward = orig_forward
ordered_dummy_inputs = {param: dummy_inputs[param] for param in sig.parameters if param in dummy_inputs}
ordered_input_names = list(inputs)
flatten_inputs = flattenize_inputs(ordered_dummy_inputs.values())
Expand Down

0 comments on commit e00c5fc

Please sign in to comment.