From 3ba4455ee618b64621139d30521f535b80836fc8 Mon Sep 17 00:00:00 2001 From: zhangsongyang Date: Tue, 6 May 2025 14:10:37 +0000 Subject: [PATCH] Update --- opencompass/partitioners/num_worker.py | 6 +++--- opencompass/utils/logging.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/opencompass/partitioners/num_worker.py b/opencompass/partitioners/num_worker.py index bcae7279..f9ab4a89 100644 --- a/opencompass/partitioners/num_worker.py +++ b/opencompass/partitioners/num_worker.py @@ -135,17 +135,17 @@ class NumWorkerPartitioner(BasePartitioner): dataset_abbr = dataset_abbr_from_cfg(dataset) test_range = dataset.reader_cfg.get('test_range', '') - # 如果不强制重建且缓存中有数据,则使用缓存 + # If not forcing rebuild and data exists in cache, use the cache if not self.force_rebuild and dataset_abbr in self.dataset_size: actual_size = eval('len(range(self.dataset_size[dataset_abbr])' f'{test_range})') return actual_size - # 否则重新构建数据集获取大小 + # Otherwise, rebuild the dataset to get its size dataset = build_dataset_from_cfg(dataset) self.dataset_size[dataset_abbr] = len(dataset.test) - # 保存到缓存文件 + # Save to cache file if self.dataset_size_path: mmengine.mkdir_or_exist('.cache/') mmengine.dump(self.dataset_size, diff --git a/opencompass/utils/logging.py b/opencompass/utils/logging.py index b0dbdcd4..fb3db986 100644 --- a/opencompass/utils/logging.py +++ b/opencompass/utils/logging.py @@ -84,7 +84,7 @@ class FilterDuplicateMessage(logging.Filter): def pretty_print_config(cfg): - """使用rich库美化配置输出.""" + """Pretty print config using the rich library.""" console = Console() config_str = cfg.pretty_text syntax = Syntax(config_str,