Lint callbacks.py
Browse files
src/axolotl/utils/callbacks.py
CHANGED
@@ -1,7 +1,8 @@
|
|
|
|
|
|
1 |
import os
|
2 |
|
3 |
from transformers import (
|
4 |
-
Seq2SeqTrainer,
|
5 |
TrainerCallback,
|
6 |
TrainingArguments,
|
7 |
TrainerState,
|
@@ -10,7 +11,9 @@ from transformers import (
|
|
10 |
from transformers.trainer_utils import PREFIX_CHECKPOINT_DIR
|
11 |
|
12 |
|
13 |
-
class SavePeftModelCallback(TrainerCallback):
|
|
|
|
|
14 |
def on_save(
|
15 |
self,
|
16 |
args: TrainingArguments,
|
|
|
1 |
+
"""Callbacks for Trainer class"""
|
2 |
+
|
3 |
import os
|
4 |
|
5 |
from transformers import (
|
|
|
6 |
TrainerCallback,
|
7 |
TrainingArguments,
|
8 |
TrainerState,
|
|
|
11 |
from transformers.trainer_utils import PREFIX_CHECKPOINT_DIR
|
12 |
|
13 |
|
14 |
+
class SavePeftModelCallback(TrainerCallback): # pylint: disable=too-few-public-methods
|
15 |
+
"""Callback to save the PEFT adapter"""
|
16 |
+
|
17 |
def on_save(
|
18 |
self,
|
19 |
args: TrainingArguments,
|