yobx.torch.in_transformers.patches#

yobx.torch.in_transformers.patches.get_patches_for(model: Module | None = None) List[PatchInfo][source]#

Returns the list of patches for a specific model. if model is None, patches everything it can.

Note

The function detects that RotaryEmbedding.forward is wrapped by checking if can find substring transformers/modeling_rope_utils.py in RotaryEmbedding.forward.__wrapped__. It does not seem to be the case with Python 3.10.