micm_nlp.models.xpe

XPE public surface.

Post-Phase-9 the XPE integration is exposed entirely through submodules:

  • configCrossPromptEncoderConfig

  • encoderCrossPromptEncoder (the prompt encoder nn.Module)

  • enumsCrossPromptEncoderReparameterizationType

  • headsLSTMWrapper, LightweightSelfAttentionHead

  • save_load — XPE-aware state-dict (de)serialization helpers

  • peft_modelsXPEPeftModelForSequenceClassification, TASK_TYPE_TO_XPE_MODEL, xpe_model_for()

  • factoryget_xpe_model(), load_xpe_pretrained(), is_xpe_config(), is_xpe_adapter_dir()

This module performs two side-effects at import time:

  1. Registers PeftType.XPE on the stdlib-backed peft.PeftType enum via aenum.extend_enum (idempotent — safe on reload).

  2. Registers PEFT_TYPE_TO_CONFIG_MAPPING[PeftType.XPE] = CrossPromptEncoderConfig so PeftConfig.from_pretrained can resolve XPE checkpoints generically.

Both must run before any CrossPromptEncoderConfig is instantiated, which is why they happen at module-import time.

Submodules