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

Method forward_wrapper

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

Source from the content-addressed store, hash-verified

386
387 # Create a wrapper that calls pre_forward_hook
388 def forward_wrapper(input_ids=None, attention_mask=None, labels=None, **kwargs):
389 return self.pre_forward_hook(input_ids=input_ids, attention_mask=attention_mask, labels=labels, **kwargs)
390
391 # Override the model's forward with our wrapper
392 model.forward = forward_wrapper

Callers

nothing calls this directly

Calls 1

pre_forward_hookMethod · 0.95

Tested by

no test coverage detected