Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
echarlaix committed Nov 3, 2023
1 parent 72ac4c3 commit d5361db
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions optimum/exporters/onnx/model_patcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,11 @@ def __enter__(self):

def __exit__(self, exc_type, exc_value, traceback):
# TODO: Remove this if once transformers if much above 4.35
if AttentionMaskConverter is not None:
AttentionMaskConverter._make_causal_mask = self.original_make_causal
# TODO: We should unpatch it - however `self._make_causal_mask` may still be called later which raises issues with this simple patch strategy.
# We need to find a proper solution.
# if AttentionMaskConverter is not None:
# AttentionMaskConverter._make_causal_mask = self.original_make_causal
pass

def __init__(
self,
Expand Down

0 comments on commit d5361db

Please sign in to comment.