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;