def _to_keras_callbacks(callbacks):
        """
        Casts AbstractKerasModel callbacks (see `cakechat.dialog_model.callbacks`) to the keras-based ones (instances of
            `keras.callbacks.Callback`)
        :param callbacks:
        :return:
        """
        keras_callbacks = []
        for custom_callback in callbacks:
            if isinstance(custom_callback, AbstractKerasModelCallback):
                keras_callback = _KerasCallbackAdapter(custom_callback)
            elif isinstance(custom_callback, ParametrizedCallback):
                keras_callback = custom_callback.callback
            else:
                raise ValueError('Unsupported callback type: {}'.format(type(custom_callback)))

            keras_callbacks.append(keras_callback)

        return keras_callbacks

        Casts AbstractKerasModel callbacks (see `cakechat.dialog_model.callbacks`) to the keras-based ones (instances of
            `keras.callbacks.Callback`)
        :param callbacks:
        :return:
        
cakechat/dialog_model/keras_model.py