Skip to content

Commit f2d48a0

Browse files
authored
ppo compat transformers>=4.47.* (#2964)
1 parent 949bbbe commit f2d48a0

File tree

30 files changed

+45
-45
lines changed

30 files changed

+45
-45
lines changed

examples/deploy/client/llm/chat/swift_client.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Copyright (c) Alibaba, Inc. and its affiliates.
2-
import asyncio
32
import os
43
from typing import List
54

examples/deploy/reward_model/client.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
from typing import List
2-
1+
# Copyright (c) Alibaba, Inc. and its affiliates.
32
from swift.llm import InferClient, InferRequest
43

54
if __name__ == '__main__':

examples/train/rlhf/ppo.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Currently, it only supports the case where the model and reward_model use the same template/tokenizer.
2+
# Currently, multimodal model PPO is not supported.
23
nproc_per_node=4
34

45
CUDA_VISIBLE_DEVICES=0,1,2,3 \

scripts/utils/run_model_info.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ def get_model_info_table():
2626
for model_type in ModelType.get_model_name_list():
2727
model_meta = MODEL_MAPPING[model_type]
2828
template = model_meta.template
29-
r = ''
3029
for group in model_meta.model_groups:
3130
for model in group.models:
3231
ms_model_id = model.ms_model_id

swift/llm/argument/base_args/quant_args.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Copyright (c) Alibaba, Inc. and its affiliates.
22

3-
from dataclasses import dataclass, field
3+
from dataclasses import dataclass
44
from typing import Literal, Optional
55

66
import torch

swift/llm/argument/merge_args.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Copyright (c) Alibaba, Inc. and its affiliates.
22
from dataclasses import dataclass
3-
from typing import Optional
43

54
from swift.utils import get_logger
65

swift/llm/argument/train_args.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from transformers.utils.versions import require_version
99

1010
from swift.plugin import LOSS_MAPPING
11-
from swift.trainers import IntervalStrategy, TrainerFactory
11+
from swift.trainers import TrainerFactory
1212
from swift.utils import (add_version_to_work_dir, get_logger, get_pai_tensorboard_dir, is_liger_available,
1313
is_local_master, is_mp, is_pai_training_job, use_torchacc)
1414
from .base_args import BaseArguments, to_abspath

swift/llm/dataset/preprocessor/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def batched_preprocess(self, batched_row: Dict[str, Any], *, strict: bool,
173173
elif self.traceback_limit is not None and self._traceback_counter < self.traceback_limit:
174174
import traceback
175175
logger.info(traceback.format_exc())
176-
logger.error('👆👆👆There are errors in the dataset, the data will be deleted')
176+
logger.warning('👆👆👆There are errors in the dataset, the data will be deleted')
177177
self._traceback_counter += 1
178178
row = []
179179
new_rows += row

swift/llm/dataset/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ def __getitem__(self, idx: int) -> Dict[str, Any]:
184184
if self.traceback_limit is not None and self._traceback_counter < self.traceback_limit:
185185
import traceback
186186
logger.info(traceback.format_exc())
187-
logger.error('👆👆👆There are errors in the template.encode, '
188-
'and another piece of data will be randomly selected.')
187+
logger.warning('👆👆👆There are errors in the template.encode, '
188+
'and another piece of data will be randomly selected.')
189189
self._traceback_counter += 1
190190

191191
def __len__(self) -> int:

swift/llm/export/merge_lora.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Copyright (c) Alibaba, Inc. and its affiliates.
22
import os
3-
import shutil
4-
import tempfile
53

64
from swift.llm import ExportArguments, prepare_model_template, save_checkpoint
75
from swift.tuners import Swift

0 commit comments

Comments
 (0)