data
PromptLearningConfig
extends
PeftConfigPromptLearningConfig(task_type: TaskType | str | None = None, peft_type: PeftType | str | None = None, auto_mapping: dict[str, str] | None = None, peft_version: str | None = None, base_model_name_or_path: str | None = None, revision: str | None = None, inference_mode: bool = False, num_virtual_tokens: int | None = None, token_dim: int | None = None, num_transformer_submodules: int | None = None, num_attention_heads: int | None = None, num_layers: int | None = None, modules_to_save: list[str] | None = None)The fields of a method that learns an input rather than a weight.
Prompt tuning, prefix tuning and p-tuning put learned vectors in front
of the input — as extra token embeddings, or as extra keys and values
of every attention layer. The sizes they need are the base model's, so
everything but num_virtual_tokens can be left None and is read
off the model's config when the adapter is built.
Parameters
The task the adapter is for (metadata; see
TaskType).The method; filled in by the subclass when omitted, refused when
it names another.
auto_ mappingdict of str to str= NoneThe class of the base model,
{"base_model_class": name, "parent_library": module} — what AutoPeftModel* rebuilds the
base with. PeftModel.save_pretrained writes it.peft_ versionstr= NoneThe library version that wrote the adapter file (metadata). Left
None it is not written; a file that carries one keeps it.base_ model_ name_ or_ pathstr= NoneName of the model the adapter was trained on (metadata).
revisionstr= NoneRevision of that model (metadata).
inference_ modebool= FalseFreeze the adapter too, for inference.
num_ virtual_ tokensint= NoneHow many learned positions go in front of the input; required by
the time the adapter is built.
token_ dimint= NoneThe model's hidden size.
num_ transformer_ submodulesint= None1 for an encoder-only or decoder-only model, 2 for an
encoder-decoder one; 2 for task_type="SEQ_2_SEQ_LM" and 1
otherwise when omitted.num_ attention_ headsint= NoneThe model's head count.
num_ layersint= NoneThe model's layer count.
modules_ to_ savelist of str= NoneModules of the model trained in full beside the prompt (a
classification head).
Used by 20
- lucid.peft
- lucid.peft._targeting
- lucid.peft.tuners._plan
- lucid.peft.tuners._prompt._encoder
- lucid.peft.tuners._prompt._geometry
- lucid.peft.tuners._prompt._sites
- lucid.peft.tuners._prompt._tuner
- lucid.peft.tuners.cartridge._config
- lucid.peft.tuners.cartridge._model
- lucid.peft.tuners.cartridge.utils
- lucid.peft.tuners.cpt._config
- lucid.peft.tuners.cpt._embedding
… 8 more