Skip to content

Commit

Permalink
review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kallewoof committed Jul 16, 2024
1 parent 4143643 commit 691178e
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/peft/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
AdaptionPromptConfig,
AdaptionPromptModel,
LoraConfig,
LoraPlusConfig,
LoraRuntimeConfig,
LoftQConfig,
LoraModel,
Expand Down Expand Up @@ -102,3 +101,4 @@
cast_mixed_precision_params,
)
from .config import PeftConfig, PromptLearningConfig
from .tuners.lora.config import LoraPlusConfig
8 changes: 3 additions & 5 deletions src/peft/optimizers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# flake8: noqa
# There's no way to ignore "F401 '...' imported but unused" warnings in this
# module, but to preserve other warnings. So, don't check this module at all

# coding=utf-8
# Copyright 2023-present the HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -18,3 +13,6 @@
# limitations under the License.

from .loraplus import create_loraplus_optimizer


__all__ = ["create_loraplus_optimizer"]
16 changes: 16 additions & 0 deletions src/peft/optimizers/loraplus.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
# Copyright 2024-present the HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""
This module contains the implementation of the LoraPlus optimizer.
"""

from __future__ import annotations

from operator import attrgetter

import torch.nn as nn
Expand Down
2 changes: 1 addition & 1 deletion src/peft/tuners/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# limitations under the License.

from .adaption_prompt import AdaptionPromptConfig, AdaptionPromptModel
from .lora import LoraConfig, LoraModel, LoftQConfig, LoraPlusConfig, LoraRuntimeConfig
from .lora import LoraConfig, LoraModel, LoftQConfig, LoraRuntimeConfig
from .loha import LoHaConfig, LoHaModel
from .lokr import LoKrConfig, LoKrModel
from .ia3 import IA3Config, IA3Model
Expand Down
2 changes: 1 addition & 1 deletion src/peft/tuners/lora/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from peft.import_utils import is_bnb_4bit_available, is_bnb_available, is_eetq_available

from .config import LoftQConfig, LoraConfig, LoraPlusConfig, LoraRuntimeConfig
from .config import LoftQConfig, LoraConfig, LoraRuntimeConfig
from .gptq import QuantLinear
from .layer import Conv2d, Embedding, Linear, LoraLayer
from .model import LoraModel
Expand Down
2 changes: 0 additions & 2 deletions src/peft/utils/peft_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class PeftType(str, enum.Enum):
- XLORA
- POLY
- LN_TUNING
- LORAPLUS
- VERA
- FOURIERFT
"""
Expand All @@ -58,7 +57,6 @@ class PeftType(str, enum.Enum):
OFT = "OFT"
POLY = "POLY"
LN_TUNING = "LN_TUNING"
LORAPLUS = "LORAPLUS"
VERA = "VERA"
FOURIERFT = "FOURIERFT"
XLORA = "XLORA"
Expand Down

0 comments on commit 691178e

Please sign in to comment.