Skip to content

Commit 29de539

Browse files
committed
replied comments
1 parent f1681b0 commit 29de539

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

optimum/exporters/openvino/model_patcher.py

+4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323

2424

2525
def patch_model_with_bettertransformer(model):
26+
# check that the model has not yet been pathced
27+
if hasattr(model, "use_bettertransformer") and model.use_bettertransformer is True:
28+
return model
29+
2630
if is_transformers_version("<", "4.36") or is_torch_version("<", "2.1.1"):
2731
COLOR_RED = "\033[1;31m"
2832
COLOR_RESET = "\033[0m"

0 commit comments

Comments
 (0)