Skip to content

Commit f7cf460

Browse files
authored
[docs] Update index and quicktour (#1191)
* first draft * fix toctree * lora subby section * feedback * iframe height * feedback
1 parent 1b1091c commit f7cf460

File tree

4 files changed

+164
-185
lines changed

4 files changed

+164
-185
lines changed

docs/source/_toctree.yml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,26 @@
99

1010
- title: Task guides
1111
sections:
12-
- local: task_guides/image_classification_lora
13-
title: Image classification using LoRA
1412
- local: task_guides/seq2seq-prefix-tuning
1513
title: Prefix tuning for conditional generation
1614
- local: task_guides/clm-prompt-tuning
1715
title: Prompt tuning for causal language modeling
18-
- local: task_guides/semantic_segmentation_lora
19-
title: Semantic segmentation using LoRA
2016
- local: task_guides/ptuning-seq-classification
2117
title: P-tuning for sequence classification
22-
- local: task_guides/dreambooth_lora
23-
title: Dreambooth fine-tuning with LoRA
24-
- local: task_guides/token-classification-lora
25-
title: LoRA for token classification
26-
- local: task_guides/int8-asr
27-
title: int8 training for automatic speech recognition
28-
- local: task_guides/semantic-similarity-lora
29-
title: Semantic similarity with LoRA
18+
- title: LoRA
19+
sections:
20+
- local: task_guides/image_classification_lora
21+
title: Image classification
22+
- local: task_guides/semantic_segmentation_lora
23+
title: Semantic segmentation
24+
- local: task_guides/token-classification-lora
25+
title: Token classification
26+
- local: task_guides/semantic-similarity-lora
27+
title: Semantic similarity
28+
- local: task_guides/int8-asr
29+
title: int8 training for automatic speech recognition
30+
- local: task_guides/dreambooth_lora
31+
title: DreamBooth
3032

3133
- title: Developer guides
3234
sections:
@@ -59,6 +61,8 @@
5961

6062
- title: Reference
6163
sections:
64+
- local: package_reference/auto_class
65+
title: AutoPeftModel
6266
- local: package_reference/peft_model
6367
title: PEFT model
6468
- local: package_reference/config

docs/source/index.md

Lines changed: 8 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@ rendered properly in your Markdown viewer.
1616

1717
# PEFT
1818

19-
🤗 PEFT, or Parameter-Efficient Fine-Tuning (PEFT), is a library for efficiently adapting pre-trained language models (PLMs) to various downstream applications without fine-tuning all the model's parameters.
20-
PEFT methods only fine-tune a small number of (extra) model parameters, significantly decreasing computational and storage costs because fine-tuning large-scale PLMs is prohibitively costly.
21-
Recent state-of-the-art PEFT techniques achieve performance comparable to that of full fine-tuning.
19+
🤗 PEFT (Parameter-Efficient Fine-Tuning) is a library for efficiently adapting large pretrained models to various downstream applications without fine-tuning all of a model's parameters because it is prohibitively costly. PEFT methods only fine-tune a small number of (extra) model parameters - significantly decreasing computational and storage costs - while yielding performance comparable to a fully fine-tuned model. This makes it more accessible to train and store large language models (LLMs) on consumer hardware.
2220

23-
PEFT is seamlessly integrated with 🤗 Accelerate for large-scale models leveraging DeepSpeed and [Big Model Inference](https://huggingface.co/docs/accelerate/usage_guides/big_modeling).
21+
PEFT is integrated with the Transformers, Diffusers, and Accelerate libraries to provide a faster and easier way to load, train, and use large models for inference.
2422

2523
<div class="mt-10">
2624
<div class="w-full flex flex-col space-y-4 md:space-y-0 md:grid md:grid-cols-2 md:gap-y-4 md:gap-x-5">
@@ -43,100 +41,9 @@ PEFT is seamlessly integrated with 🤗 Accelerate for large-scale models levera
4341
</div>
4442
</div>
4543

46-
## Supported methods
47-
48-
1. LoRA: [LORA: LOW-RANK ADAPTATION OF LARGE LANGUAGE MODELS](https://arxiv.org/pdf/2106.09685.pdf)
49-
2. Prefix Tuning: [Prefix-Tuning: Optimizing Continuous Prompts for Generation](https://aclanthology.org/2021.acl-long.353/), [P-Tuning v2: Prompt Tuning Can Be Comparable to Fine-tuning Universally Across Scales and Tasks](https://arxiv.org/pdf/2110.07602.pdf)
50-
3. P-Tuning: [GPT Understands, Too](https://arxiv.org/pdf/2103.10385.pdf)
51-
4. Prompt Tuning: [The Power of Scale for Parameter-Efficient Prompt Tuning](https://arxiv.org/pdf/2104.08691.pdf)
52-
5. AdaLoRA: [Adaptive Budget Allocation for Parameter-Efficient Fine-Tuning](https://arxiv.org/abs/2303.10512)
53-
6. [LLaMA-Adapter: Efficient Fine-tuning of Language Models with Zero-init Attention](https://github.com/ZrrSkywalker/LLaMA-Adapter)
54-
7. IA3: [Infused Adapter by Inhibiting and Amplifying Inner Activations](https://arxiv.org/abs/2205.05638)
55-
56-
## Supported models
57-
58-
The tables provided below list the PEFT methods and models supported for each task. To apply a particular PEFT method for
59-
a task, please refer to the corresponding Task guides.
60-
61-
### Causal Language Modeling
62-
63-
| Model | LoRA | Prefix Tuning | P-Tuning | Prompt Tuning | IA3 |
64-
|--------------| ---- | ---- | ---- | ---- | ---- |
65-
| GPT-2 ||||||
66-
| Bloom ||||||
67-
| OPT ||||||
68-
| GPT-Neo ||||||
69-
| GPT-J ||||||
70-
| GPT-NeoX-20B ||||||
71-
| LLaMA ||||||
72-
| ChatGLM ||||||
73-
74-
### Conditional Generation
75-
76-
| Model | LoRA | Prefix Tuning | P-Tuning | Prompt Tuning | IA3 |
77-
| --------- | ---- | ---- | ---- | ---- | ---- |
78-
| T5 ||||||
79-
| BART ||||||
80-
81-
### Sequence Classification
82-
83-
| Model | LoRA | Prefix Tuning | P-Tuning | Prompt Tuning | IA3 |
84-
| --------- | ---- | ---- | ---- | ---- | ---- |
85-
| BERT ||||||
86-
| RoBERTa ||||||
87-
| GPT-2 ||||| |
88-
| Bloom ||||| |
89-
| OPT ||||| |
90-
| GPT-Neo ||||| |
91-
| GPT-J ||||| |
92-
| Deberta || ||| |
93-
| Deberta-v2 || ||| |
94-
95-
### Token Classification
96-
97-
| Model | LoRA | Prefix Tuning | P-Tuning | Prompt Tuning | IA3 |
98-
| --------- | ---- | ---- | ---- | ---- | --- |
99-
| BERT ||| | | |
100-
| RoBERTa ||| | | |
101-
| GPT-2 ||| | | |
102-
| Bloom ||| | | |
103-
| OPT ||| | | |
104-
| GPT-Neo ||| | | |
105-
| GPT-J ||| | | |
106-
| Deberta || | | | |
107-
| Deberta-v2 || | | | |
108-
109-
### Text-to-Image Generation
110-
111-
| Model | LoRA | Prefix Tuning | P-Tuning | Prompt Tuning | IA3 |
112-
| --------- | ---- | ---- | ---- | ---- | ---- |
113-
| Stable Diffusion || | | | |
114-
115-
116-
### Image Classification
117-
118-
| Model | LoRA | Prefix Tuning | P-Tuning | Prompt Tuning | IA3 |
119-
| --------- | ---- | ---- | ---- | ---- | ---- | ---- |
120-
| ViT || | | | |
121-
| Swin || | | | |
122-
123-
### Image to text (Multi-modal models)
124-
125-
We have tested LoRA for [ViT](https://huggingface.co/docs/transformers/model_doc/vit) and [Swin](https://huggingface.co/docs/transformers/model_doc/swin) for fine-tuning on image classification.
126-
However, it should be possible to use LoRA for any [ViT-based model](https://huggingface.co/models?pipeline_tag=image-classification&sort=downloads&search=vit) from 🤗 Transformers.
127-
Check out the [Image classification](/task_guides/image_classification_lora) task guide to learn more. If you run into problems, please open an issue.
128-
129-
| Model | LoRA | Prefix Tuning | P-Tuning | Prompt Tuning | IA3 |
130-
| --------- | ---- | ---- | ---- | ---- | ---- |
131-
| Blip-2 || | | | |
132-
133-
134-
### Semantic Segmentation
135-
136-
As with image-to-text models, you should be able to apply LoRA to any of the [segmentation models](https://huggingface.co/models?pipeline_tag=image-segmentation&sort=downloads).
137-
It's worth noting that we haven't tested this with every architecture yet. Therefore, if you come across any issues, kindly create an issue report.
138-
139-
| Model | LoRA | Prefix Tuning | P-Tuning | Prompt Tuning | IA3 |
140-
| --------- | ---- | ---- | ---- | ---- | ---- |
141-
| SegFormer || | | | |
142-
44+
<iframe
45+
src="https://stevhliu-peft-methods.hf.space"
46+
frameborder="0"
47+
width="850"
48+
height="620"
49+
></iframe>
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<!--Copyright 2023 The HuggingFace Team. All rights reserved.
2+
3+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
4+
the License. You may obtain a copy of the License at
5+
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
8+
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
9+
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
10+
specific language governing permissions and limitations under the License.
11+
12+
⚠️ Note that this file is in Markdown but contain specific syntax for our doc-builder (similar to MDX) that may not be
13+
rendered properly in your Markdown viewer.
14+
15+
-->
16+
17+
# AutoPeftModels
18+
19+
The `AutoPeftModel` classes loads the appropriate PEFT model for the task type by automatically inferring it from the configuration file. They are designed to quickly and easily load a PEFT model in a single line of code without having to worry about which exact model class you need or manually loading a [`PeftConfig`].
20+
21+
## AutoPeftModel
22+
23+
[[autodoc]] auto.AutoPeftModel
24+
- from_pretrained
25+
26+
## AutoPeftModelForCausalLM
27+
28+
[[autodoc]] auto.AutoPeftModelForCausalLM
29+
30+
## AutoPeftModelForSeq2SeqLM
31+
32+
[[autodoc]] auto.AutoPeftModelForSeq2SeqLM
33+
34+
## AutoPeftModelForSequenceClassification
35+
36+
[[autodoc]] auto.AutoPeftModelForSequenceClassification
37+
38+
## AutoPeftModelForTokenClassification
39+
40+
[[autodoc]] auto.AutoPeftModelForTokenClassification
41+
42+
## AutoPeftModelForQuestionAnswering
43+
44+
[[autodoc]] auto.AutoPeftModelForQuestionAnswering
45+
46+
## AutoPeftModelForFeatureExtraction
47+
48+
[[autodoc]] auto.AutoPeftModelForFeatureExtraction

0 commit comments

Comments
 (0)