Skip to content

Commit

Permalink
Bug Fix in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
FBerding committed Oct 3, 2023
1 parent f14d124 commit 706341d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
conda_install(
packages = c(
"tensorflow-cpu",
"torch",
"torch-cpu",
"keras",
"accelerate"),
envname = envname,
Expand Down
28 changes: 3 additions & 25 deletions tests/testthat/test-04_transformer_models.R
Original file line number Diff line number Diff line change
Expand Up @@ -748,35 +748,13 @@ for(ai_method in ai_methods){
ml_framework = framework
)
)
}
)
}
}

for(ai_method in ai_methods){
for(framework in ml_frameworks){
if(framework=="tensorflow"){
other_framework="pytorch"
} else {
other_framework="tensorflow"
}

tmp_path=testthat::test_path(
paste0(
"test_artefacts/tmp_full_models/",
other_framework,"/",
ai_method,"_embedding")
)

test_that(paste(ai_method,"load from",other_framework,"to",framework,"framework_check"),{
test<-load_ai_model(
model_dir = tmp_path,
ml_framework = framework)

tmp<-test$get_transformer_components()[[4]]

expect_equal(tmp,framework)
})

}
)
}
}

2 changes: 1 addition & 1 deletion tests/testthat/test-14_classifier_neural_net.R
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ for (n_classes in 2:3){
text_embeddings=current_embeddings,
targets=example_targets,
hidden=NULL,
rec=c(4,4),
rec=c(3,3),
self_attention_heads = 0,
dropout=0.2,
recurrent_dropout=0.4,
Expand Down

0 comments on commit 706341d

Please sign in to comment.