yobx.torch.patch_enum#
- class yobx.torch.patch_enum.TransformersPatchEnum(*values)[source]#
Selects which transformers-related patches
apply_patches_for_model()should apply. Members can be combined with|.NONE— no transformers patches are applied.YOBX_PATCH— applies yobx’s own transformers patches (rotary embedding wrappers, flattening helpers, …).TRANSFORMERS_PATCH— toggles the ONNX-export switches that transformers itself ships (config.onnx_export,module.prepare_for_onnx_export_()).ALL— shortcut forYOBX_PATCH | TRANSFORMERS_PATCH.
- yobx.torch.patch_enum.coerce_transformers_patch(value: bool | TransformersPatchEnum | str) TransformersPatchEnum[source]#
Backward-compat conversion:
True->ALL,False->NONE.