Skip to content

Commit

Permalink
raise error
Browse files Browse the repository at this point in the history
  • Loading branch information
jiqing-feng committed Jul 23, 2024
1 parent 5c27181 commit 6d12238
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions optimum/intel/ipex/modeling_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -632,9 +632,9 @@ def generate(self, *args, **kwargs):
_patch_crop_past_key_values()
try:
result = super().generate(*args, **kwargs)
except Exception as error:
except Exception as e:
_unpatch_crop_past_key_values()
assert False, f"IPEXModelForCausalLM generation failed due to {error}"
raise e
_unpatch_crop_past_key_values()
return result

Expand Down

0 comments on commit 6d12238

Please sign in to comment.