micm_nlp.models.xpe¶
XPE public surface.
Post-Phase-9 the XPE integration is exposed entirely through submodules:
config—CrossPromptEncoderConfigencoder—CrossPromptEncoder(the prompt encoder nn.Module)enums—CrossPromptEncoderReparameterizationTypeheads—LSTMWrapper,LightweightSelfAttentionHeadsave_load— XPE-aware state-dict (de)serialization helperspeft_models—XPEPeftModelForSequenceClassification,TASK_TYPE_TO_XPE_MODEL,xpe_model_for()factory—get_xpe_model(),load_xpe_pretrained(),is_xpe_config(),is_xpe_adapter_dir()
This module performs two side-effects at import time:
Registers
PeftType.XPEon the stdlib-backedpeft.PeftTypeenum viaaenum.extend_enum(idempotent — safe on reload).Registers
PEFT_TYPE_TO_CONFIG_MAPPING[PeftType.XPE] = CrossPromptEncoderConfigsoPeftConfig.from_pretrainedcan resolve XPE checkpoints generically.
Both must run before any CrossPromptEncoderConfig is instantiated, which
is why they happen at module-import time.