MCPcopy Create free account
hub / github.com/appdevforall/CodeOnTheGo / get_model_or_exit

Function get_model_or_exit

subprojects/llama.cpp/tests/get-model.cpp:7–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5#include "get-model.h"
6
7char * get_model_or_exit(int argc, char *argv[]) {
8 char * model_path;
9 if (argc > 1) {
10 model_path = argv[1];
11
12 } else {
13 model_path = getenv("LLAMACPP_TEST_MODELFILE");
14 if (!model_path || strlen(model_path) == 0) {
15 fprintf(stderr, "\033[33mWARNING: No model file provided. Skipping this test. Set LLAMACPP_TEST_MODELFILE=<gguf_model_path> to silence this warning and run this test.\n\033[0m");
16 exit(EXIT_SUCCESS);
17 }
18 }
19
20 return model_path;
21}

Callers 3

mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected