From 513def8cd5775d4b9a5e1c5f4783116b8a314573 Mon Sep 17 00:00:00 2001 From: kevinykuo Date: Wed, 1 Apr 2020 14:49:16 +0800 Subject: [PATCH] bundle testing_data --- .github/workflows/deploy.yaml | 5 ++++- app/app.R | 7 +------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index a297ec8..d9364db 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -10,10 +10,13 @@ jobs: - uses: r-lib/actions/setup-r@master - name: Download dependencies run: | - install.packages(c("piggyback", "remotes")) + install.packages(c("piggyback", "remotes", "pins")) remotes::install_github("rstudio/connectapi") piggyback::pb_download(file = "model_artifacts/toy-model.tar.gz", repo = "kasaai/cork") untar("model_artifacts/toy-model.tar.gz", exdir = "app") + pins::board_register_github(name = "cork", repo = "kasaai/cork") + testing_data <- pins::pin_get("toy-model-testing-data", board = "cork") + saveRDS(testing_data, "app/testing_data.rds") shell: Rscript {0} - name: Deploy env: diff --git a/app/app.R b/app/app.R index c0f8b76..706de8e 100644 --- a/app/app.R +++ b/app/app.R @@ -10,13 +10,8 @@ library(iBreakDown) library(reticulate) library(tensorflow) library(keras) -library(pins) -# Need to use the following branch of {ingredients} -# remotes::install_github("kevinykuo/ingredients", ref = "weights") - -pins::board_register_github(name = "cork", repo = "kasaai/cork") -testing_data <- pins::pin_get("toy-model-testing-data", board = "cork") +testing_data <- readRDS("testing_data.rds") toy_model <- keras::load_model_tf("model_artifacts/toy-model") predictors <- c(