Peft

Latest version: v0.14.0

Safety actively analyzes 714815 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 4 of 5

0.6.1

This patch release fixes the compatbility issues with Adaptation Prompt that users faced with transformers 4.35.0. Moreover, it fixes an issue with token classification PEFT models when saving them using safetensors

Adaptation prompt fixes

* FIX: Skip adaption prompt tests with new transformers versions by BenjaminBossan in https://github.com/huggingface/peft/pull/1077
* FIX: fix adaptation prompt CI and compatibility with latest transformers (4.35.0) by younesbelkada in https://github.com/huggingface/peft/pull/1084

Safetensors fixes:

* [`core`] Fix safetensors serialization for shared tensors by younesbelkada in https://github.com/huggingface/peft/pull/1101

What's Changed
* After release: Bump version to 0.7.0.dev0 by BenjaminBossan in https://github.com/huggingface/peft/pull/1074
* Improve documentation for IA³ by SumanthRH in https://github.com/huggingface/peft/pull/984
* [`Docker`] Update Dockerfile to force-use transformers main by younesbelkada in https://github.com/huggingface/peft/pull/1085
* Update the release checklist by BenjaminBossan in https://github.com/huggingface/peft/pull/1075
* fix-gptq-training by SunMarc in https://github.com/huggingface/peft/pull/1086
* fix the failing CI tests by pacman100 in https://github.com/huggingface/peft/pull/1094
* Fix f-string in import_utils by KCFindstr in https://github.com/huggingface/peft/pull/1091
* Fix IA3 config for Falcon models by SumanthRH in https://github.com/huggingface/peft/pull/1007
* FIX: Failing nightly CI tests due to IA3 config by BenjaminBossan in https://github.com/huggingface/peft/pull/1100
* Change to 0.6.1.dev0 by younesbelkada in https://github.com/huggingface/peft/pull/1102

New Contributors
* KCFindstr made their first contribution in https://github.com/huggingface/peft/pull/1091

**Full Changelog**: https://github.com/huggingface/peft/compare/v0.6.0...v0.6.1

0.6.0

New Contributors
* Psancs05 made their first contribution in https://github.com/huggingface/peft/pull/847
* metaprotium made their first contribution in https://github.com/huggingface/peft/pull/844
* jiqing-feng made their first contribution in https://github.com/huggingface/peft/pull/851
* houx15 made their first contribution in https://github.com/huggingface/peft/pull/888
* tmm1 made their first contribution in https://github.com/huggingface/peft/pull/874
* raghavanone made their first contribution in https://github.com/huggingface/peft/pull/891
* zspo made their first contribution in https://github.com/huggingface/peft/pull/898
* rohithkrn made their first contribution in https://github.com/huggingface/peft/pull/892
* Datta0 made their first contribution in https://github.com/huggingface/peft/pull/946
* kbulutozler made their first contribution in https://github.com/huggingface/peft/pull/982
* Pairshoe made their first contribution in https://github.com/huggingface/peft/pull/964
* ehcalabres made their first contribution in https://github.com/huggingface/peft/pull/1049

**Full Changelog**: https://github.com/huggingface/peft/compare/v0.5.0...v0.6.0

0.6.0.dev0

* DOC: Add a contribution guide by BenjaminBossan in https://github.com/huggingface/peft/pull/848
* clarify the new model size by stas00 in https://github.com/huggingface/peft/pull/839
* DOC: Remove backlog section from README.md by BenjaminBossan in https://github.com/huggingface/peft/pull/853
* MNT: Refactor tuner forward methods for simplicity by BenjaminBossan in https://github.com/huggingface/peft/pull/833
* 🎉 Add Multitask Prompt Tuning by mayank31398 in https://github.com/huggingface/peft/pull/400
* Fix typos in ia3.py by metaprotium in https://github.com/huggingface/peft/pull/844
* Support merge lora module for 4bit and 8bit linear by jiqing-feng in https://github.com/huggingface/peft/pull/851
* Fix seq2seq prompt tuning (439) by glerzing in https://github.com/huggingface/peft/pull/809
* MNT: Move tuners to subpackages by BenjaminBossan in https://github.com/huggingface/peft/pull/807
* FIX: Error in forward of 4bit linear lora layer by BenjaminBossan in https://github.com/huggingface/peft/pull/878
* MNT: Run tests that were skipped previously by BenjaminBossan in https://github.com/huggingface/peft/pull/884
* FIX: PeftModel save_pretrained Doc (881) by houx15 in https://github.com/huggingface/peft/pull/888
* Upgrade docker actions to higher versions by younesbelkada in https://github.com/huggingface/peft/pull/889
* Fix error using deepspeed zero2 + load_in_8bit + lora by tmm1 in https://github.com/huggingface/peft/pull/874
* Fix doc for semantic_segmentation_lora by raghavanone in https://github.com/huggingface/peft/pull/891
* fix_gradient_accumulation_steps_in_examples by zspo in https://github.com/huggingface/peft/pull/898
* FIX: linting issue in example by BenjaminBossan in https://github.com/huggingface/peft/pull/908
* ENH Remove redundant initialization layer calls by BenjaminBossan in https://github.com/huggingface/peft/pull/887
* [docs] Remove duplicate section by stevhliu in https://github.com/huggingface/peft/pull/911
* support prefix tuning for starcoder models by pacman100 in https://github.com/huggingface/peft/pull/913
* Merge lora module to 8bit model by jiqing-feng in https://github.com/huggingface/peft/pull/875
* DOC: Section on common issues encountered with PEFT by BenjaminBossan in https://github.com/huggingface/peft/pull/909
* Enh speed up init emb conv2d by BenjaminBossan in https://github.com/huggingface/peft/pull/915
* Make base_model.peft_config single source of truth by BenjaminBossan in https://github.com/huggingface/peft/pull/921
* Update accelerate dependency version by rohithkrn in https://github.com/huggingface/peft/pull/892
* fix lora layer init by SunMarc in https://github.com/huggingface/peft/pull/928
* Fixed LoRA conversion for kohya_ss by kovalexal in https://github.com/huggingface/peft/pull/916
* [`CI`] Pin diffusers by younesbelkada in https://github.com/huggingface/peft/pull/936
* [`LoRA`] Add scale_layer / unscale_layer by younesbelkada in https://github.com/huggingface/peft/pull/935
* TST: Add GH action to run unit tests with torch.compile by BenjaminBossan in https://github.com/huggingface/peft/pull/943
* FIX: torch compile gh action installs pytest by BenjaminBossan in https://github.com/huggingface/peft/pull/944
* Fix NotImplementedError for no bias. by Datta0 in https://github.com/huggingface/peft/pull/946
* TST: Fix some tests that would fail with torch.compile by BenjaminBossan in https://github.com/huggingface/peft/pull/949
* ENH Allow compile GH action to run on torch nightly by BenjaminBossan in https://github.com/huggingface/peft/pull/952
* Install correct PyTorch nightly in GH action by BenjaminBossan in https://github.com/huggingface/peft/pull/954
* support multiple ranks and alphas for LoRA by pacman100 in https://github.com/huggingface/peft/pull/873
* feat: add type hints by SauravMaheshkar in https://github.com/huggingface/peft/pull/858
* FIX: setting requires_grad on adapter layers by BenjaminBossan in https://github.com/huggingface/peft/pull/905
* [`tests`] add transformers & diffusers integration tests by younesbelkada in https://github.com/huggingface/peft/pull/962
* Fix integrations_tests.yml by younesbelkada in https://github.com/huggingface/peft/pull/965
* Add 4-bit support to IA3 - Outperforms QLoRA in both speed and memory consumption by His-Wardship in https://github.com/huggingface/peft/pull/864
* Update integrations_tests.yml by younesbelkada in https://github.com/huggingface/peft/pull/966
* add the lora target modules for Mistral Models by pacman100 in https://github.com/huggingface/peft/pull/974
* TST: Fix broken save_pretrained tests by BenjaminBossan in https://github.com/huggingface/peft/pull/969
* [tests] add multiple active adapters tests by pacman100 in https://github.com/huggingface/peft/pull/961
* Fix missing tokenizer attribute in test by BenjaminBossan in https://github.com/huggingface/peft/pull/977
* Add implementation of LyCORIS LoHa (FedPara-like adapter) for SD&SDXL models by kovalexal in https://github.com/huggingface/peft/pull/956
* update BibTeX by pacman100 in https://github.com/huggingface/peft/pull/989
* FIX: issues with (un)merging multiple LoRA and IA³ adapters by BenjaminBossan in https://github.com/huggingface/peft/pull/976
* add lora target modules for stablelm models by kbulutozler in https://github.com/huggingface/peft/pull/982
* Correct minor errors in example notebooks for causal language modelling by SumanthRH in https://github.com/huggingface/peft/pull/926
* Fix typo in custom_models.mdx by Pairshoe in https://github.com/huggingface/peft/pull/964
* Add base model metadata to model card by BenjaminBossan in https://github.com/huggingface/peft/pull/975
* MNT Make .merged a property by BenjaminBossan in https://github.com/huggingface/peft/pull/979
* Fix lora creation by pacman100 in https://github.com/huggingface/peft/pull/993
* TST: Comment out flaky LoHA test by BenjaminBossan in https://github.com/huggingface/peft/pull/1002
* ENH Support Conv2d layers for IA³ by BenjaminBossan in https://github.com/huggingface/peft/pull/972
* Fix word_embeddings match for deepspeed wrapped model by mayank31398 in https://github.com/huggingface/peft/pull/1000
* FEAT: Add `safe_merge` option in `merge` by younesbelkada in https://github.com/huggingface/peft/pull/1001
* [`core` / `LoRA`] Add `safe_merge` to bnb layers by younesbelkada in https://github.com/huggingface/peft/pull/1009
* ENH: Refactor LoRA bnb layers for faster initialization by BenjaminBossan in https://github.com/huggingface/peft/pull/994
* FIX Don't assume model_config contains the key model_type by BenjaminBossan in https://github.com/huggingface/peft/pull/1012
* FIX stale.py uses timezone-aware datetime by BenjaminBossan in https://github.com/huggingface/peft/pull/1016
* FEAT: Add fp16 + cpu merge support by younesbelkada in https://github.com/huggingface/peft/pull/1017
* fix lora scaling and unscaling by pacman100 in https://github.com/huggingface/peft/pull/1027
* [`LoRA`] Revert original behavior for scale / unscale by younesbelkada in https://github.com/huggingface/peft/pull/1029
* [`LoRA`] Raise error when adapter name not found in `set_scale` by younesbelkada in https://github.com/huggingface/peft/pull/1034
* Fix target_modules type in config.from_pretrained by BenjaminBossan in https://github.com/huggingface/peft/pull/1046
* docs(README): bit misspell current path link StackLLaMa by guspan-tanadi in https://github.com/huggingface/peft/pull/1047
* Fixed wrong construction of LoHa weights, updated adapters conversion script by kovalexal in https://github.com/huggingface/peft/pull/1021
* Fix P-tuning for sequence classification docs by ehcalabres in https://github.com/huggingface/peft/pull/1049
* FIX: Setting active adapter correctly by BenjaminBossan in https://github.com/huggingface/peft/pull/1051
* Fix Conv1D merge error for IA3 by SumanthRH in https://github.com/huggingface/peft/pull/1014
* Add implementation of LyCORIS LoKr (KronA-like adapter) for SD&SDXL models by kovalexal in https://github.com/huggingface/peft/pull/978
* [`core`] Fix `use_reentrant` issues by younesbelkada in https://github.com/huggingface/peft/pull/1036
* [`tests`] Update Dockerfile to use cuda 12.2 by younesbelkada in https://github.com/huggingface/peft/pull/1050
* Add testing for regex matching and other custom kwargs by SumanthRH in https://github.com/huggingface/peft/pull/1031
* Fix Slack bot not displaying error messages by younesbelkada in https://github.com/huggingface/peft/pull/1068
* Fix slow tests not running by younesbelkada in https://github.com/huggingface/peft/pull/1071

0.5.0

GPTQ Integration
Now, you can finetune GPTQ quantized models using PEFT. Here are some examples of how to use PEFT with a GPTQ model: [colab notebook](https://colab.research.google.com/drive/1_TIrmuKOFhuRRiTWN94iLKUFu6ZX4ceb?usp=sharing) and [finetuning](https://gist.github.com/SunMarc/dcdb499ac16d355a8f265aa497645996) script.

* GPTQ Integration by SunMarc in https://github.com/huggingface/peft/pull/771

Low-level API
Enables users and developers to use PEFT as a utility library, at least for injectable adapters (LoRA, IA3, AdaLoRA). It exposes an API to modify the model in place to inject the new layers into the model.

* [`core`] PEFT refactor + introducing inject_adapter_in_model public method by younesbelkada https://github.com/huggingface/peft/pull/749
* [`Low-level-API`] Add docs about LLAPI by younesbelkada in https://github.com/huggingface/peft/pull/836

Support for XPU and NPU devices

Leverage the support for more devices for loading and fine-tuning PEFT adapters.

* Support XPU adapter loading by abhilash1910 in https://github.com/huggingface/peft/pull/737
* Support Ascend NPU adapter loading by statelesshz in https://github.com/huggingface/peft/pull/772

Mix-and-match LoRAs

Stable support and new ways of merging multiple LoRAs. There are currently 3 ways of merging loras supported: `linear`, `svd` and `cat`.

* Added additional parameters to mixing multiple LoRAs through SVD, added ability to mix LoRAs through concatenation by kovalexal in https://github.com/huggingface/peft/pull/817

What's Changed

0.5.0.dev0

* Fix subfolder issue by younesbelkada in https://github.com/huggingface/peft/pull/721
* Add falcon to officially supported LoRA & IA3 modules by younesbelkada in https://github.com/huggingface/peft/pull/722
* revert change by pacman100 in https://github.com/huggingface/peft/pull/731
* fix(pep561): include packaging type information by aarnphm in https://github.com/huggingface/peft/pull/729
* [`Llama2`] Add disabling TP behavior by younesbelkada in https://github.com/huggingface/peft/pull/728
* [`Patch`] patch trainable params for 4bit layers by younesbelkada in https://github.com/huggingface/peft/pull/733
* FIX: Warning when initializing prompt encoder by BenjaminBossan in https://github.com/huggingface/peft/pull/716
* ENH: Warn when disabling adapters and bias != 'none' by BenjaminBossan in https://github.com/huggingface/peft/pull/741
* FIX: Disabling adapter works with modules_to_save by BenjaminBossan in https://github.com/huggingface/peft/pull/736
* Updated Example in Class:LoraModel by TianyiPeng in https://github.com/huggingface/peft/pull/672
* [`AdaLora`] Fix adalora inference issue by younesbelkada in https://github.com/huggingface/peft/pull/745
* Add btlm to officially supported LoRA by Trapper4888 in https://github.com/huggingface/peft/pull/751
* [`ModulesToSave`] add correct hook management for modules to save by younesbelkada in https://github.com/huggingface/peft/pull/755
* Example notebooks for LoRA with custom models by BenjaminBossan in https://github.com/huggingface/peft/pull/724
* Add tests for AdaLoRA, fix a few bugs by BenjaminBossan in https://github.com/huggingface/peft/pull/734
* Add progressbar unload/merge by BramVanroy in https://github.com/huggingface/peft/pull/753
* Support XPU adapter loading by abhilash1910 in https://github.com/huggingface/peft/pull/737
* Support Ascend NPU adapter loading by statelesshz in https://github.com/huggingface/peft/pull/772
* Allow passing inputs_embeds instead of input_ids by BenjaminBossan in https://github.com/huggingface/peft/pull/757
* [`core`] PEFT refactor + introducing `inject_adapter_in_model` public method by younesbelkada in https://github.com/huggingface/peft/pull/749
* Add adapter error handling by BenjaminBossan in https://github.com/huggingface/peft/pull/800
* add lora default target module for codegen by sywangyi in https://github.com/huggingface/peft/pull/787
* DOC: Update docstring of PeftModel.from_pretrained by BenjaminBossan in https://github.com/huggingface/peft/pull/799
* fix crash when using torch.nn.DataParallel for LORA inference by sywangyi in https://github.com/huggingface/peft/pull/805
* Peft model signature by kiansierra in https://github.com/huggingface/peft/pull/784
* GPTQ Integration by SunMarc in https://github.com/huggingface/peft/pull/771
* Only fail quantized Lora unload when actually merging by BlackHC in https://github.com/huggingface/peft/pull/822
* Added additional parameters to mixing multiple LoRAs through SVD, added ability to mix LoRAs through concatenation by kovalexal in https://github.com/huggingface/peft/pull/817
* TST: add test about loading custom models by BenjaminBossan in https://github.com/huggingface/peft/pull/827
* Fix unbound error in ia3.py by His-Wardship in https://github.com/huggingface/peft/pull/794
* [`Docker`] Fix gptq dockerfile by younesbelkada in https://github.com/huggingface/peft/pull/835
* [`Tests`] Add 4bit slow training tests by younesbelkada in https://github.com/huggingface/peft/pull/834
* [`Low-level-API`] Add docs about LLAPI by younesbelkada in https://github.com/huggingface/peft/pull/836
* Type annotation fix by vwxyzjn in https://github.com/huggingface/peft/pull/840

New Contributors
* TianyiPeng made their first contribution in https://github.com/huggingface/peft/pull/672
* Trapper4888 made their first contribution in https://github.com/huggingface/peft/pull/751
* abhilash1910 made their first contribution in https://github.com/huggingface/peft/pull/737
* statelesshz made their first contribution in https://github.com/huggingface/peft/pull/772
* kiansierra made their first contribution in https://github.com/huggingface/peft/pull/784
* BlackHC made their first contribution in https://github.com/huggingface/peft/pull/822
* His-Wardship made their first contribution in https://github.com/huggingface/peft/pull/794
* vwxyzjn made their first contribution in https://github.com/huggingface/peft/pull/840

**Full Changelog**: https://github.com/huggingface/peft/compare/v0.4.0...v0.5.0

0.4.0

QLoRA Support:
QLoRA uses 4-bit quantization to compress a pretrained language model. The LM parameters are then frozen and a relatively small number of trainable parameters are added to the model in the form of Low-Rank Adapters. During finetuning, QLoRA backpropagates gradients through the frozen 4-bit quantized pretrained language model into the Low-Rank Adapters. The LoRA layers are the only parameters being updated during training. For more details read the blog [Making LLMs even more accessible with bitsandbytes, 4-bit quantization and QLoRA
](https://huggingface.co/blog/4bit-transformers-bitsandbytes)

* 4-bit QLoRA via bitsandbytes (4-bit base model + LoRA) by TimDettmers in https://github.com/huggingface/peft/pull/476
* [`core`] Protect 4bit import by younesbelkada in https://github.com/huggingface/peft/pull/480
* [`core`] Raise warning on using `prepare_model_for_int8_training` by younesbelkada in https://github.com/huggingface/peft/pull/483

New PEFT methods: IA3 from T-Few paper
To make fine-tuning more efficient, IA3 (Infused Adapter by Inhibiting and Amplifying Inner Activations) rescales inner activations with learned vectors. These learned vectors are injected into the attention and feedforward modules in a typical transformer-based architecture. These learned vectors are the only trainable parameters during fine-tuning, and thus the original weights remain frozen. Dealing with learned vectors (as opposed to learned low-rank updates to a weight matrix like LoRA) keeps the number of trainable parameters much smaller. For more details, read the paper [Few-Shot Parameter-Efficient Fine-Tuning is Better and Cheaper than In-Context Learning](https://arxiv.org/abs/2205.05638)

* Add functionality to support IA3 by SumanthRH in https://github.com/huggingface/peft/pull/578

Support for new tasks: QA and Feature Extraction
Addition of `PeftModelForQuestionAnswering` and `PeftModelForFeatureExtraction` classes to support QA and Feature Extraction tasks, respectively. This enables exciting new use-cases with PEFT, e.g., [LoRA for semantic similarity tasks](https://huggingface.co/docs/peft/task_guides/semantic-similarity-lora).

* feat: Add PeftModelForQuestionAnswering by sjrl in https://github.com/huggingface/peft/pull/473
* add support for Feature Extraction using PEFT by pacman100 in https://github.com/huggingface/peft/pull/647

AutoPeftModelForxxx for better and Simplified UX
Introduces a new paradigm, AutoPeftModelForxxx intended for users that want to rapidly load and run peft models.


from peft import AutoPeftModelForCausalLM

peft_model = AutoPeftModelForCausalLM.from_pretrained("ybelkada/opt-350m-lora")


* Introducing `AutoPeftModelForxxx` by younesbelkada in https://github.com/huggingface/peft/pull/694


LoRA for custom models
Not a transformer model, no problem, we have got you covered. PEFT now enables the usage of LoRA with custom models.

* FEAT: Make LoRA work with custom models by BenjaminBossan in https://github.com/huggingface/peft/pull/676

New LoRA utilities
Improvements to `add_weighted_adapter` method to support SVD for combining multiple LoRAs when creating new LoRA.
New utils such as `unload` and `delete_adapter` providing users much better control about how they deal with the adapters.

* [Core] Enhancements and refactoring of LoRA method by pacman100 in https://github.com/huggingface/peft/pull/695

PEFT and Stable Diffusion
PEFT is very extensible and easy to use for performing DreamBooth of Stable Diffusion. Community has added conversion scripts to be able to use PEFT models with Civitai/webui format and vice-versa.

* LoRA for Conv2d layer, script to convert kohya_ss LoRA to PEFT by kovalexal in https://github.com/huggingface/peft/pull/461
* Added Civitai LoRAs conversion to PEFT, PEFT LoRAs conversion to webui by kovalexal in https://github.com/huggingface/peft/pull/596
* [Bugfix] Fixed LoRA conv2d merge by kovalexal in https://github.com/huggingface/peft/pull/637
* Fixed LoraConfig alpha modification on add_weighted_adapter by kovalexal in https://github.com/huggingface/peft/pull/654

What's Changed

Page 4 of 5

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.