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 ...@@ -8,5 +8,4 @@ from .lark import * # noqa
from .logging import * # noqa from .logging import * # noqa
from .menu import * # noqa from .menu import * # noqa
from .prompt import * # noqa from .prompt import * # noqa
from .summarizer import * # noqa
from .text_postprocessors import * # noqa from .text_postprocessors import * # noqa
import os.path as osp import os.path as osp
from typing import Dict from typing import Dict, List, Union
from mmengine.config import ConfigDict 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.""" """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: if 'abbr' in cfg:
return cfg['abbr'] return cfg['abbr']
model_abbr = cfg['type'] + '_' + '_'.join( model_abbr = cfg['type'] + '_' + '_'.join(
......
...@@ -21,6 +21,7 @@ rouge ...@@ -21,6 +21,7 @@ rouge
rouge_chinese rouge_chinese
rouge_score rouge_score
scikit_learn==1.2.1 scikit_learn==1.2.1
seaborn
sentence_transformers==2.2.2 sentence_transformers==2.2.2
tabulate tabulate
tiktoken tiktoken
......
...@@ -7,9 +7,10 @@ from datetime import datetime ...@@ -7,9 +7,10 @@ from datetime import datetime
from mmengine.config import Config, DictAction from mmengine.config import Config, DictAction
from opencompass.partitioners import MultimodalNaivePartitioner 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.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, from opencompass.utils.run import (exec_mm_infer_runner, fill_eval_cfg,
fill_infer_cfg, get_config_from_arg) fill_infer_cfg, get_config_from_arg)
...@@ -315,7 +316,11 @@ def main(): ...@@ -315,7 +316,11 @@ def main():
# visualize # visualize
if args.mode in ['all', 'eval', 'viz']: 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) 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