From 39fb96316fa7c72cdfe95b9b7b63ff71fe85b942 Mon Sep 17 00:00:00 2001 From: Steven Date: Thu, 30 Mar 2023 14:16:01 -0700 Subject: [PATCH] first draft of api docs --- docs/source/_toctree.yml | 3 +- docs/source/package_reference/config.mdx | 19 +++++++++- docs/source/package_reference/peft_model.mdx | 37 +++++++++++++++++++- docs/source/package_reference/tuners.mdx | 36 ++++++++++++++++++- 4 files changed, 91 insertions(+), 4 deletions(-) diff --git a/docs/source/_toctree.yml b/docs/source/_toctree.yml index 1255844..12f8901 100644 --- a/docs/source/_toctree.yml +++ b/docs/source/_toctree.yml @@ -19,4 +19,5 @@ - local: package_reference/config title: Configuration - local: package_reference/tuners - title: Tuners \ No newline at end of file + title: Tuners + diff --git a/docs/source/package_reference/config.mdx b/docs/source/package_reference/config.mdx index af4abbf..1a2212f 100644 --- a/docs/source/package_reference/config.mdx +++ b/docs/source/package_reference/config.mdx @@ -1 +1,18 @@ -# Configuration \ No newline at end of file +# Configuration + +The configuration classes stores the configuration of a [`PeftModel`], PEFT adapter models, and the configurations of [`PrefixTuning`], [`PromptTuning`], and [`PromptEncoder`]. They contain methods for saving and loading model configurations from the Hub, specifying the PEFT method to use, type of task to perform, and model configurations like number of layers and number of attention heads. + +## PeftConfigMixin + +[[autodoc]] PeftConfigMixin + - all + +## PeftConfig + +[[autodoc]] PeftConfig + - all + +## PromptLearningConfig + +[[autodoc]] PromptLearningConfig + - all diff --git a/docs/source/package_reference/peft_model.mdx b/docs/source/package_reference/peft_model.mdx index f6789d4..771fd49 100644 --- a/docs/source/package_reference/peft_model.mdx +++ b/docs/source/package_reference/peft_model.mdx @@ -1 +1,36 @@ -# PEFT model \ No newline at end of file +## Models + +[`PeftModel`] is the base model class for specifying the base Transformer model and configuration to apply a PEFT method to. The base `PeftModel` contains methods for loading and saving models from the Hub, and supports the [`PromptEncoder`] for prompt learning. + +## PeftModel + +[[autodoc]] PeftModel + - all + +## PeftModelForSequenceClassification + +A `PeftModel` for sequence classification tasks. + +[[autodoc]] PeftModelForSequenceClassification + - all + +## PeftModelForTokenClassification + +A `PeftModel` for token classification tasks. + +[[autodoc]] PeftModelForTokenClassification + - all + +## PeftModelForCausalLM + +A `PeftModel` for causal language modeling. + +[[autodoc]] PeftModelForCausalLM + - all + +## PeftModelForSeq2SeqLM + +A `PeftModel` for sequence-to-sequence language modeling. + +[[autodoc]] PeftModelForSeq2SeqLM + - all diff --git a/docs/source/package_reference/tuners.mdx b/docs/source/package_reference/tuners.mdx index 1e60f16..93c0dc6 100644 --- a/docs/source/package_reference/tuners.mdx +++ b/docs/source/package_reference/tuners.mdx @@ -1 +1,35 @@ -# Tuners \ No newline at end of file +# Tuners + +Each tuner (or PEFT method) has a configuration and model. + +## LoRA + +For finetuning a model with LoRA. + +[[autodoc]] LoraConfig + +[[autodoc]] LoraModel + +[[autodoc]] LoraLayer + +[[autodoc]] Linear + +[[autodoc]] MergedLinear + +## P-tuning + +[[autodoc]] PromptEncoderConfig + +[[autodoc]] PromptEncoder + +## Prefix tuning + +[[autodoc]] PrefixTuningConfig + +[[autodoc]] PrefixEncoder + +## Prompt tuning + +[[autodoc]] PromptTuningConfig + +[[autodoc]] PromptEmbedding