Unverified Commit fbf5089c authored by Leymore's avatar Leymore Committed by GitHub
Browse files

[Sync] update github token (#475)

parent 362c33df
......@@ -8,5 +8,4 @@ from .lark import * # noqa
from .logging import * # noqa
from .menu import * # noqa
from .prompt import * # noqa
from .summarizer import * # noqa
from .text_postprocessors import * # noqa
import os.path as osp
from typing import Dict
from typing import Dict, List, Union
from mmengine.config import ConfigDict
def model_abbr_from_cfg(cfg: ConfigDict) -> str:
def model_abbr_from_cfg(cfg: Union[ConfigDict, List[ConfigDict]]) -> str:
"""Generate model abbreviation from the model's confg."""
if isinstance(cfg, (list, tuple)):
return '_'.join(model_abbr_from_cfg(c) for c in cfg)
if 'abbr' in cfg:
return cfg['abbr']
model_abbr = cfg['type'] + '_' + '_'.join(
......
......@@ -21,6 +21,7 @@ rouge
rouge_chinese
rouge_score
scikit_learn==1.2.1
seaborn
sentence_transformers==2.2.2
tabulate
tiktoken
......
......@@ -7,9 +7,10 @@ from datetime import datetime
from mmengine.config import Config, DictAction
from opencompass.partitioners import MultimodalNaivePartitioner
from opencompass.registry import PARTITIONERS, RUNNERS
from opencompass.registry import PARTITIONERS, RUNNERS, build_from_cfg
from opencompass.runners import SlurmRunner
from opencompass.utils import LarkReporter, Summarizer, get_logger
from opencompass.summarizers import DefaultSummarizer
from opencompass.utils import LarkReporter, get_logger
from opencompass.utils.run import (exec_mm_infer_runner, fill_eval_cfg,
fill_infer_cfg, get_config_from_arg)
......@@ -315,7 +316,11 @@ def main():
# visualize
if args.mode in ['all', 'eval', 'viz']:
summarizer = Summarizer(cfg)
summarizer_cfg = cfg.get('summarizer', {})
if not summarizer_cfg or summarizer_cfg.get('type', None) is None:
summarizer_cfg['type'] = DefaultSummarizer
summarizer_cfg['config'] = cfg
summarizer = build_from_cfg(summarizer_cfg)
summarizer.summarize(time_str=cfg_time_str)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment