Skip to content

Commit

Permalink
Fix Logger
Browse files Browse the repository at this point in the history
Signed-off-by: cwj <talkingwallace@sohu.com>
  • Loading branch information
talkingwallace committed Jun 29, 2023
1 parent a9cec8a commit 00c5d4d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion fate_flow
14 changes: 7 additions & 7 deletions python/fate/ml/nn/trainer/trainer_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@
from typing import Optional
import time
from dataclasses import dataclass, field, fields
from transformers import trainer, trainer_callback


# Reset huggingface logging
logger = transformers_logging.get_logger("transformers")
# Reset the logger to redirect logs output
transformers_logging.disable_default_handler()
handler = logging.StreamHandler()
handler.setFormatter(logging.Formatter('%(asctime)s [%(levelname)s] - %(message)s', datefmt='%Y-%m-%d %H:%M:%S'))
logger.setLevel(logging.INFO)
logger.addHandler(handler)
transformers_logging.enable_propagation()
logger = logging.getLogger(__name__)
# trainer.logger = logging.getLogger("transformers trainer")
# trainer_callback.logger = logger


def time_decorator(descr=""):
Expand Down Expand Up @@ -482,7 +482,7 @@ def _server_check_parameters(self):
def on_train_begin(self, args: TrainingArguments, state: TrainerState, control: TrainerControl, **kwargs):

if self.trainer_class.local_mode:
logger.info('local model, skipping federated parameter checking')
logger.info('FedParameterAlignCallback: local model, skipping federated parameter checking')
return
else:
if self.is_server:
Expand Down

0 comments on commit 00c5d4d

Please sign in to comment.