in tools/validator.py [0:0]
def __init__(self,
yaml_parser_by_tag_name: Mapping[
str, yaml_parser_lib.AbstractYamlParser],
publisher: str,
model_name: str,
model_version: str,
required_metadata: AbstractSet[str],
optional_metadata: AbstractSet[str],
supported_asset_path_suffix: Optional[str] = None) -> None:
"""Initializes a ParsingPolicy instance for validating a document.
Args:
yaml_parser_by_tag_name: Mapping from a tag name to its
yaml_parser_lib.YamlParser instance to be used for accessing allowed
metadata values from the YAML config files.
publisher: The name of the publisher of the model e.g. 'Google'.
model_name: The name of the model e.g. 'ALBERT'.
model_version: The version of the model e.g. '1'.
required_metadata: Set of strings containing the required tag names that
need to be set in the Markdown document e.g. {"asset-path"}.
optional_metadata: Set of strings containing the optional tag names that
can be set in the Markdown document e.g. {"dataset"}.
supported_asset_path_suffix: Optional; The file ending of the 'asset-path'
tag, if that tag needs to be set.
"""
self._yaml_parser_by_tag_name = yaml_parser_by_tag_name
self._publisher = publisher
self._model_name = model_name
self._model_version = model_version
self._required_metadata = required_metadata
self._optional_metadata = optional_metadata
self._supported_asset_path_suffix = supported_asset_path_suffix