tests/testthat/_snaps/keras.md

can print keras model

Code
  v
Output

  -- cars-keras - <bundled_keras> model for deployment 
  A sequential keras model with 2 layers using 10 features

create plumber.R for keras

Code
  cat(readr::read_lines(tmp), sep = "\n")
Output
  # Generated by the vetiver package; edit with care

  library(pins)
  library(plumber)
  library(rapidoc)
  library(vetiver)

  # Packages needed to generate model predictions
  if (FALSE) {
      library(keras)
  }
  b <- board_folder(path = "<redacted>")
  v <- vetiver_pin_read(b, "cars-keras")

  #* @plumber
  function(pr) {
      pr %>% vetiver_api(v)
  }
Code
  cat(readr::read_lines(fs::path(fs::path_dir(tmp), "requirements.txt")), sep = "\n")
Output
  keras
  tensorflow
Code
  vetiver_write_docker(v, tmp, tmp_dir)
Condition
  Warning:
  Your `vetiver_model` object contains a keras model
  i Be sure to use an appropriate `base_image` such as `rocker/cuda`


tidymodels/vetiver documentation built on Oct. 15, 2024, 4:16 p.m.