def persist(self) -> None:
    'Persist this model into the passed directory.'
    if (self.model is None):
        return None
    with self._model_storage.write_to(self._resource) as model_path:
        file_name = self.__class__.__name__
        tf_model_file = (model_path / f'{file_name}.tf_model')
        rasa.shared.utils.io.create_directory_for_file(tf_model_file)
        if (self.component_config[CHECKPOINT_MODEL] and self.tmp_checkpoint_dir):
            self.model.load_weights((self.tmp_checkpoint_dir / 'checkpoint.tf_model'))
            checkpoint_marker = (model_path / f'{file_name}.from_checkpoint.pkl')
            checkpoint_marker.touch()
        self.model.save(str(tf_model_file))
        io_utils.pickle_dump((model_path / f'{file_name}.data_example.pkl'), self._data_example)
        io_utils.pickle_dump((model_path / f'{file_name}.sparse_feature_sizes.pkl'), self._sparse_feature_sizes)
        io_utils.pickle_dump((model_path / f'{file_name}.label_data.pkl'), dict(self._label_data.data))
        io_utils.json_pickle((model_path / f'{file_name}.index_label_id_mapping.json'), self.index_label_id_mapping)
        entity_tag_specs = ([tag_spec._asdict() for tag_spec in self._entity_tag_specs] if self._entity_tag_specs else [])
        rasa.shared.utils.io.dump_obj_as_json_to_file((model_path / f'{file_name}.entity_tag_specs.json'), entity_tag_specs)
Persist this model into the passed directory.
def persist(self) -> None:
    
    if (self.model is None):
        return None
    with self._model_storage.write_to(self._resource) as model_path:
        file_name = self.__class__.__name__
        tf_model_file = (model_path / f'{file_name}.tf_model')
        rasa.shared.utils.io.create_directory_for_file(tf_model_file)
        if (self.component_config[CHECKPOINT_MODEL] and self.tmp_checkpoint_dir):
            self.model.load_weights((self.tmp_checkpoint_dir / 'checkpoint.tf_model'))
            checkpoint_marker = (model_path / f'{file_name}.from_checkpoint.pkl')
            checkpoint_marker.touch()
        self.model.save(str(tf_model_file))
        io_utils.pickle_dump((model_path / f'{file_name}.data_example.pkl'), self._data_example)
        io_utils.pickle_dump((model_path / f'{file_name}.sparse_feature_sizes.pkl'), self._sparse_feature_sizes)
        io_utils.pickle_dump((model_path / f'{file_name}.label_data.pkl'), dict(self._label_data.data))
        io_utils.json_pickle((model_path / f'{file_name}.index_label_id_mapping.json'), self.index_label_id_mapping)
        entity_tag_specs = ([tag_spec._asdict() for tag_spec in self._entity_tag_specs] if self._entity_tag_specs else [])
        rasa.shared.utils.io.dump_obj_as_json_to_file((model_path / f'{file_name}.entity_tag_specs.json'), entity_tag_specs)