Skip to content

Commit

Permalink
Unhook cross attention processor (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
rockerBOO authored Nov 30, 2023
1 parent a323129 commit b32e133
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions daam/trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,12 @@ def __call__(
return hidden_states

def _hook_impl(self):
self.original_processor = self.module.processor
self.module.set_processor(self)

def _unhook_impl(self):
self.module.set_processor(self.original_processor)

@property
def num_heat_maps(self):
return len(next(iter(self.heat_maps.values())))
Expand Down

0 comments on commit b32e133

Please sign in to comment.