# -*- coding: utf-8 -*-
# @Time    : 2019/8/23 21:55
# @Author  : zhoujun
import copy
from .model import Model
from .losses import build_loss

__all__ = ["build_loss", "build_model"]
support_model = ["Model"]


def build_model(config):
    """
    get architecture model class
    """
    copy_config = copy.deepcopy(config)
    arch_type = copy_config.pop("type")
    assert (
        arch_type in support_model
    ), f"{arch_type} is not developed yet!, only {support_model} are support now"
    arch_model = eval(arch_type)(copy_config)
    return arch_model
