Update test-model-load-cancel

This commit is contained in:
crasm 2024-01-19 22:35:05 -05:00
parent 86c3eab119
commit d6cf33d6c5

View file

@ -2,11 +2,21 @@
#include <cstdio> #include <cstdio>
#include <cstdlib> #include <cstdlib>
#include <cstring>
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"); auto * file = fopen(model_path, "r");
if (file == nullptr) { if (file == nullptr) {
fprintf(stderr, "no model at '%s' found\n", model_path); fprintf(stderr, "no model at '%s' found\n", model_path);
return EXIT_FAILURE; return EXIT_FAILURE;