|
1 | 1 | # Copyright (c) Alibaba, Inc. and its affiliates. |
2 | 2 | # Part of the implementation is borrowed from huggingface/transformers. |
3 | 3 | import inspect |
| 4 | +import logging |
4 | 5 | import os |
5 | 6 | import shutil |
6 | 7 | import time |
|
33 | 34 | from swift.llm import BatchSamplerShard, DataLoaderDispatcher, DataLoaderShard, Template |
34 | 35 | from swift.plugin import MeanMetric, compute_acc, extra_tuners |
35 | 36 | from swift.tuners import SwiftModel |
36 | | -from swift.utils import get_logger, is_mp_ddp, seed_worker, use_torchacc |
| 37 | +from swift.utils import get_logger, is_mp_ddp, ms_logger_context, seed_worker, use_torchacc |
37 | 38 | from swift.utils.torchacc_utils import ta_trim_graph |
38 | 39 | from ..utils.torch_utils import get_device_count |
39 | 40 | from .arguments import TrainingArguments |
@@ -68,8 +69,7 @@ def __init__(self, |
68 | 69 | logger.warning('Using IterableDataset, setting args.dataloader_num_workers to 1.') |
69 | 70 |
|
70 | 71 | if args.check_model and hasattr(model, 'model_dir'): |
71 | | - from swift.utils.logger import ms_logger_ignore_error |
72 | | - with ms_logger_ignore_error(): |
| 72 | + with ms_logger_context(logging.CRITICAL): |
73 | 73 | check_local_model_is_latest( |
74 | 74 | model.model_dir, user_agent={ |
75 | 75 | 'invoked_by': 'local_trainer', |
|
0 commit comments