I’m trying to follow the docs for using Vetiver to get a ML model deployed to a cloud resource but I’m having issues running my Vetiver API.
I’m using the following code but when I run the server using pr_run(port = 8080) I don’t get the full interactive endpoint that’s discussed in the example described here
pacman::p_load(tidymodels, vetiver, googleCloudRunner, ranger, pins, plumber)
# Example data
data(iris)
# Split the data
set.seed(123)
split <- initial_split(iris, prop = 0.8)
train_data <- training(split)
test_data <- testing(split)
# Define the model
model_spec <- rand_forest() %>%
set_mode("classification") %>%
set_engine("ranger")
# Define the workflow
workflow <- workflow() %>%
add_model(model_spec) %>%
add_formula(Species ~ .)
# Train the model
rf_fit <- workflow %>%
fit(data = train_data)
# Version the model
v <- vetiver_model(rf_fit, "iris_rf")
model_board <- board_temp()
model_board %>%
vetiver_pin_write(v)
pr() %>%
vetiver_api(v) %>%
pr_run(port = 8080)
I get the following window but there’s option for interactivity. Any suggestions for resolving this would be greatly appreciated.