(model_contents: dict,
                  module_name: str,
                  framework_name=None)
return target_framework, component_converter.convert(model_contents)
Convert a Homo model component into format of a common ML framework

    :param model_contents: The model dict un-serialized from the model protobuf.
    :param module_name: The module name, typically as HomoXXXX.
    :param framework_name: The wanted framework, e.g. "sklearn", "pytorch", etc.
                           If not specified, the target framework will be chosen
                           automatically.
    :return: the converted framework name and a instance of the model object from
             the specified framework.
Convert a Homo model component into format of a common ML framework
Convert a Homo model component into format of a common ML framework
def model_convert(model_contents: dict,
                  module_name: str,
                  framework_name=None):
    """Convert a Homo model component into format of a common ML framework

    :param model_contents: The model dict un-serialized from the model protobuf.
    :param module_name: The module name, typically as HomoXXXX.
    :param framework_name: The wanted framework, e.g. "sklearn", "pytorch", etc.
                           If not specified, the target framework will be chosen
                           automatically.
    :return: the converted framework name and a instance of the model object from
             the specified framework.
    """

    if not framework_name:
        framework_name = get_default_target_framework(model_contents, module_name)
        if not framework_name:
            return None, None
    target_framework, component_converter = _get_component_converter(module_name, framework_name)
    if not component_converter:
        LOGGER.warn(f"Module {module_name} cannot be converted to framework {framework_name}")
        return None, None
    LOGGER.info(f"Converting {module_name} module to a model of framework {target_framework}")

    return target_framework, component_converter.convert(model_contents)
def model_convert ( model_contents : dict , module_name : str , framework_name = None ) : if not framework_name : framework_name = get_default_target_framework ( model_contents , module_name ) if not framework_name : return None , None target_framework , component_converter = _get_component_converter ( module_name , framework_name ) if not component_converter : LOGGER . warn ( f"Module {module_name} cannot be converted to framework {framework_name}" ) return None , None LOGGER . info ( f"Converting {module_name} module to a model of framework {target_framework}" ) return target_framework , component_converter . convert ( model_contents )