Skip to content

Commit

Permalink
Reorganisation of test for GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
FBerding committed Jun 7, 2023
1 parent 63d0baa commit f89087e
Show file tree
Hide file tree
Showing 19 changed files with 23 additions and 61,261 deletions.
3 changes: 2 additions & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Trial
^README\.Rmd$
materials
test_model
tests/testthat/test_data
tests/testthat/test_data/language_models
test/testthat/test_data/tmp
.git
.gitignore
_pkgdown.yml
Expand Down
24 changes: 12 additions & 12 deletions .Rhistory
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
example_data<-data.frame(
id=quanteda::docvars(quanteda.textmodels::data_corpus_moviereviews)$id1,
label=quanteda::docvars(quanteda.textmodels::data_corpus_moviereviews)$sentiment)
example_data$text<-as.character(quanteda.textmodels::data_corpus_moviereviews)
expect_no_error(
create_roberta_model(
model_dir=testthat::test_path("test_data/roberta"),
vocab_raw_texts=example_data$text,
vocab_size=30522,
add_prefix_space=FALSE,
max_position_embeddings=512,
hidden_size=768,
num_hidden_layer=12,
num_attention_heads=12,
intermediate_size=3072,
Expand Down Expand Up @@ -510,3 +498,15 @@ gc()
devtools::build_site()
devtools::document()
devtools::build_site()
usethis::use_github_action_check_standard()
devtools::build_readme()
devtools::document()
devtools::check()
devtools::check()
devtools::check()
devtools::test()
devtools::check()
devtools::test()
devtools::document()
devtools::check()
reticulate::py_config()
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ udpipe_models
language_models
.Rhistory
*.h5
tests/testthat/test_data/language_models
test/testthat/test_data/tmp
2 changes: 1 addition & 1 deletion tests/testthat/test-basic_text_rep.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

path="test_data/vocab_draft_movie_review.rda"
path="test_data/gvc_lda/vocab_draft_movie_review.rda"
testthat::skip_if_not(condition=file.exists(testthat::test_path(path)),
message = "Necessary dataset not available")
#------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-classifier_neural_net.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
testthat::skip_if_not(condition=check_aif_py_modules(trace = FALSE),
message = "Necessary python modules not available")

path="test_data/bert_embeddings.rda"
path="test_data/classifier/bert_embeddings.rda"
testthat::skip_if_not(condition=file.exists(testthat::test_path(path)),
message = "Necessary dataset not available")

Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-text_embedding_model_gvc_lda.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
path="test_data/basic_text_rep_movie_reviews.rda"
path="test_data/gvc_lda/basic_text_rep_movie_reviews.rda"
testthat::skip_if_not(condition=file.exists(path),
message = "Necessary dataset not available")

Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-train_bert_model.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ test_that("train_tune_bert_model", {
multi_process=FALSE,
trace=FALSE))
expect_no_error(
train_tune_bert_model(output_dir=testthat::test_path("test_data/tmp"),
train_tune_bert_model(output_dir=testthat::test_path("test_data/bert"),
bert_model_dir_path=testthat::test_path("test_data/bert"),
raw_texts= example_data$text[1:5],
aug_vocab_by=100,
Expand All @@ -41,7 +41,7 @@ test_that("train_tune_bert_model", {
trace=FALSE))

expect_no_error(
train_tune_bert_model(output_dir=testthat::test_path("test_data/tmp"),
train_tune_bert_model(output_dir=testthat::test_path("test_data/bert"),
bert_model_dir_path=testthat::test_path("test_data/bert"),
raw_texts= example_data$text[1:5],
aug_vocab_by=0,
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-train_longformer_model.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ testthat::skip_on_cran()
testthat::skip_if_not(condition=check_aif_py_modules(trace=FALSE),
message = "Necessary python modules not available")
testthat::skip_if_not(condition = dir.exists(testthat::test_path("test_data/longformer")),
message = "Necessary bert model not available")
message = "Necessary longformer model not available")
aifeducation::set_config_gpu_low_memory()

test_that("train_tune_longformer_model", {
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-train_roberta_model.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ testthat::skip_on_cran()
testthat::skip_if_not(condition=check_aif_py_modules(trace=FALSE),
message = "Necessary python modules not available")
testthat::skip_if_not(condition = dir.exists(testthat::test_path("test_data/roberta")),
message = "Necessary bert model not available")
message = "Necessary roberta model not available")
aifeducation::set_config_gpu_low_memory()

test_that("train_tune_roberta_model", {
Expand Down
24 changes: 0 additions & 24 deletions tests/testthat/test_data/config.json

This file was deleted.

38 changes: 0 additions & 38 deletions tests/testthat/test_data/data_examples.R

This file was deleted.

7 changes: 0 additions & 7 deletions tests/testthat/test_data/special_tokens_map.json

This file was deleted.

Binary file removed tests/testthat/test_data/tf_model.h5
Binary file not shown.
Loading

0 comments on commit f89087e

Please sign in to comment.