Skip to content

Commit

Permalink
- bugfix for un-aligned types (int v.s. float) caused by two OPs
Browse files Browse the repository at this point in the history
- improve the usability for logfile_name when running several exps in the same workdir
  • Loading branch information
yxdyc committed Dec 20, 2023
1 parent a137b30 commit 4320177
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions data_juicer/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,14 +324,14 @@ def init_setup_from_cfg(cfg):
"""

cfg.export_path = os.path.abspath(cfg.export_path)
export_path = cfg.export_path
cfg.work_dir = os.path.dirname(export_path)
cfg.work_dir = os.path.dirname(cfg.export_path)
export_rel_path = os.path.relpath(cfg.export_path, start=cfg.work_dir)
log_dir = os.path.join(cfg.work_dir, 'log')
if not os.path.exists(log_dir):
os.makedirs(log_dir, exist_ok=True)
timestamp = time.strftime('%Y%m%d%H%M%S', time.localtime(time.time()))
cfg.timestamp = timestamp
logfile_name = f'export_{export_path}_time_{timestamp}.txt'
logfile_name = f'export_{export_rel_path}_time_{timestamp}.txt'
setup_logger(save_dir=log_dir,
filename=logfile_name,
redirect=cfg.executor_type == 'default')
Expand Down

0 comments on commit 4320177

Please sign in to comment.