def create_component_by_name(component_name, config): # type: (Text, Dict[Text, Any]) -> Optional[Component] """Resolves a components name and calls it's create method to init it based on a previously persisted model.""" from rasa_nlu.components import create_component component_clz = get_component_class(component_name) return create_component(component_clz, config)
def create_component_by_name(component_name, config): # type: (Text, Dict[Text, Any]) -> Optional[Component] """Resolves a components name and calls it's load method to init it based on a previously persisted model.""" from rasa_nlu.components import create_component component_clz = get_component_class(component_name) return create_component(component_clz, config)
def test_create_can_handle_none(): assert create_component(None, {}) is None