From d6cf33d6c507c1cbb0c4223ca031de2736e3e921 Mon Sep 17 00:00:00 2001 From: crasm Date: Fri, 19 Jan 2024 22:35:05 -0500 Subject: [PATCH] Update test-model-load-cancel --- tests/test-model-load-cancel.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tests/test-model-load-cancel.cpp b/tests/test-model-load-cancel.cpp index 926a305da..a2c1acf53 100644 --- a/tests/test-model-load-cancel.cpp +++ b/tests/test-model-load-cancel.cpp @@ -2,11 +2,21 @@ #include #include +#include + +int main(int argc, char *argv[] ) { + char * model_path; + if (argc > 1) { + model_path = argv[1]; + } else { + model_path = getenv("GG_RUN_CTEST_MODELFILE"); + if (!model_path || strlen(model_path) == 0) { + fprintf(stderr, "error: no model file provided\n"); + exit(1); + } + } -int main(void) { - const auto * model_path = "models/7B/ggml-model-f16.gguf"; auto * file = fopen(model_path, "r"); - if (file == nullptr) { fprintf(stderr, "no model at '%s' found\n", model_path); return EXIT_FAILURE;