micm_nlp.models.xpe.config¶
Configuration dataclass for XPE.
Classes¶
This is the configuration class to store the configuration of a [CrossPromptEncoder]. |
Module Contents¶
- class micm_nlp.models.xpe.config.CrossPromptEncoderConfig¶
Bases:
peft.PromptEncoderConfigThis is the configuration class to store the configuration of a [CrossPromptEncoder].
- Parameters:
encoder_embedding_init_type (str) – The type of initialization to use for the embedding.
encoder_init_state_dict_path (str) – The path to pretraine encoder state for initialization shared embeddings and encoder heads.
encoder_embedding_freeze (bool) – The indicator of frozen or trainable embedding.
modules_to_save (Optional[List[str]]) – List of modules apart from CrossPromptEncoder layers to be set as trainable and saved in the final checkpoint.
encoder_embedding_normalize (str) – The type of normalization to use for the embedding (None,unit, clip).
encoder_embedding_normalize_max_norm (float) – The maximum norm for the embedding.
encoder_input_size (int) – The input size for the encoder.
encoder_num_heads (int) – The number of attention heads in the encoder.
- classmethod from_peft_type(**kwargs)¶
Loads the configuration from a set of kwargs. Present for API parity with upstream PeftConfig subclasses; defers to the dataclass __init__.
- encoder_embedding_freeze: bool = True¶
- encoder_embedding_init_type: str = 'hf_default'¶
- encoder_embedding_normalize: str | None = None¶
- encoder_embedding_normalize_max_norm: float | None = None¶
- encoder_freeze: bool = True¶
- encoder_init_state_dict_path: str = None¶
- encoder_input_size: int | None = None¶
- encoder_num_heads: int = 8¶
- encoder_ratio: float = 0.7¶
- modules_to_save: list[str] | None = None¶