MCPcopy Create free account
hub / github.com/GreenBitAI/low_bit_llama / Catcher

Class Catcher

evaluate.py:24–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22 cache = {'i': 0, 'attention_mask': None}
23
24 class Catcher(nn.Module):
25
26 def __init__(self, module):
27 super().__init__()
28 self.module = module
29
30 def forward(self, inp, **kwargs):
31 inps[cache['i']] = inp
32 cache['i'] += 1
33 cache['attention_mask'] = kwargs['attention_mask']
34 cache['position_ids'] = kwargs['position_ids']
35 raise ValueError
36
37 layers[0] = Catcher(layers[0])
38 for i in range(nsamples):

Callers 1

llama_evalFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected