Browse Source

[to #42322933] do not check training config in pipeline()

Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/10407849
master
bin.xue 3 years ago
parent
commit
155856301f
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      modelscope/utils/config.py

+ 4
- 2
modelscope/utils/config.py View File

@@ -609,11 +609,12 @@ class Config:
return parse_fn(args)


def check_config(cfg: Union[str, ConfigDict]):
def check_config(cfg: Union[str, ConfigDict], is_training=False):
""" Check whether configuration file is valid, If anything wrong, exception will be raised.

Args:
cfg (str or ConfigDict): Config file path or config object.
is_training: indicate if checking training related elements
"""

if isinstance(cfg, str):
@@ -627,8 +628,9 @@ def check_config(cfg: Union[str, ConfigDict]):
check_attr(ConfigFields.task)
check_attr(ConfigFields.pipeline)

if hasattr(cfg, ConfigFields.train):
if is_training:
check_attr(ConfigFields.model)
check_attr(ConfigFields.train)
check_attr(ConfigFields.preprocessor)
check_attr(ConfigFields.evaluation)



Loading…
Cancel
Save