micm_nlp.models.xpe.peft_models¶
XPE-scoped PeftModel subclasses, one per supported TaskType.
Replaces the legacy global monkey-patching. All overrides live on a shared
_XPEPeftMixin so every task-type variant inherits the same XPE
behaviour while non-XPE peft_type values still reach the stock upstream
path via super().
Supported task types are registered in TASK_TYPE_TO_XPE_MODEL and
resolved by xpe_model_for(). The factory (xpe.factory) uses this
registry to pick the right subclass for get_xpe_model /
load_xpe_pretrained — no hardcoded SEQ_CLS assumption.
Attributes¶
Classes¶
PEFT causal-LM model driven by the Cross-Prompt Encoder. |
|
PEFT sequence-classification model driven by the Cross-Prompt Encoder. |
Functions¶
|
Resolve the XPE PeftModel subclass for a given |
Module Contents¶
- class micm_nlp.models.xpe.peft_models.XPEPeftModelForCausalLM¶
Bases:
_XPEPeftMixin,peft.PeftModelForCausalLMPEFT causal-LM model driven by the Cross-Prompt Encoder.
- class micm_nlp.models.xpe.peft_models.XPEPeftModelForSequenceClassification¶
Bases:
_XPEPeftMixin,peft.PeftModelForSequenceClassificationPEFT sequence-classification model driven by the Cross-Prompt Encoder.
- micm_nlp.models.xpe.peft_models.xpe_model_for(task_type) type[peft.PeftModel]¶
Resolve the XPE PeftModel subclass for a given
task_type.Accepts a
TaskTypeenum value or its string spelling (as read fromadapter_config.json). RaisesValueErrorfor unsupported task types.
- micm_nlp.models.xpe.peft_models.TASK_TYPE_TO_XPE_MODEL: dict[peft.TaskType, type[peft.PeftModel]]¶