/** * Returns a XGBoost model loader given the serialized model stored in the model URI. * * @param supplier {@link XGBoostModel} supplier. */ static XGBoostLoader create( final ThrowableSupplier<XGBoostModel> supplier, final Executor executor) { return ModelLoader.load(supplier, executor)::get; } }
/** * Returns a TensorFlow model loader based on a serialized TensorFlow {@link Graph}. * * @param supplier {@link TensorFlowGraphModel} supplier. * @param executor the executor to use for asynchronous execution. */ static TensorFlowGraphLoader create( final ThrowableSupplier<TensorFlowGraphModel> supplier, final Executor executor) { return ModelLoader.load(supplier, executor)::get; } }
/** * Returns a TensorFlow model loader based on a saved model. * * @param supplier {@link TensorFlowModel} supplier. * @param executor the executor to use for asynchronous execution. */ static TensorFlowLoader create( final ThrowableSupplier<TensorFlowModel> supplier, final Executor executor) { return ModelLoader.load(supplier, executor)::get; } }
/** * Returns a blocking {@link ModelLoader}. Blocks till the model is loaded or a {@link Duration} * is met. * * @param supplier model supplier. * @param duration Amount of time that it should wait, if necessary, for model to be loaded. * @param executor the executor to use for asynchronous execution. * @param <M> Underlying model instance. */ static <M extends Model<?>> PreLoader<M> preload( final ThrowableSupplier<M> supplier, final Duration duration, final Executor executor) throws InterruptedException, ExecutionException, TimeoutException { return preload(ModelLoader.load(supplier, executor), duration)::get; }