Instructions to use 1112lee/kaggle with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use 1112lee/kaggle with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("openai-community/gpt2-medium") model = PeftModel.from_pretrained(base_model, "1112lee/kaggle") - Notebooks
- Google Colab
- Kaggle
Download working/peft/docs/source/package_reference/lora.md from 1112lee/kaggle: direct link, hf CLI and curl.
- Browser
- Download file 2.12 kB
-
https://huggingface.co/1112lee/kaggle/resolve/main/working/peft/docs/source/package_reference/lora.md
- Command line
-
hf download hf://1112lee/kaggle/working/peft/docs/source/package_reference/lora.md
-
curl -L -o lora.md https://huggingface.co/1112lee/kaggle/resolve/main/working/peft/docs/source/package_reference/lora.md
LoRA
Low-Rank Adaptation (LoRA) is a PEFT method that decomposes a large matrix into two smaller low-rank matrices in the attention layers. This drastically reduces the number of parameters that need to be fine-tuned.
The abstract from the paper is:
We propose a neural language modeling system based on low-rank adaptation (LoRA) for speech recognition output rescoring. Although pretrained language models (LMs) like BERT have shown superior performance in second-pass rescoring, the high computational cost of scaling up the pretraining stage and adapting the pretrained models to specific domains limit their practical use in rescoring. Here we present a method based on low-rank decomposition to train a rescoring BERT model and adapt it to new domains using only a fraction (0.08%) of the pretrained parameters. These inserted matrices are optimized through a discriminative training objective along with a correlation-based regularization loss. The proposed low-rank adaptation Rescore-BERT (LoRB) architecture is evaluated on LibriSpeech and internal datasets with decreased training times by factors between 5.4 and 3.6..
LoraConfig
[[autodoc]] tuners.lora.config.LoraConfig
LoraModel
[[autodoc]] tuners.lora.model.LoraModel
Utility
[[autodoc]] utils.loftq_utils.replace_lora_weights_loftq