MCPcopy Create free account
hub / github.com/LUMIA-Group/MemoryDecoder / forward_wrapper

Method forward_wrapper

knn_utils/saveEmbedMulti.py:126–127  ·  view source on GitHub ↗
(input_ids=None, attention_mask=None, labels=None, **kwargs)

Source from the content-addressed store, hash-verified

124
125 # Create a wrapper that calls pre_forward_hook, ensuring that self still refers to KNNSaverMulti
126 def forward_wrapper(input_ids=None, attention_mask=None, labels=None, **kwargs):
127 return self.pre_forward_hook(input_ids=input_ids, attention_mask=attention_mask, labels=labels, **kwargs)
128
129 # Override the model's forward with our wrapper
130 model.forward = forward_wrapper

Callers

nothing calls this directly

Calls 1

pre_forward_hookMethod · 0.95

Tested by

no test coverage detected