MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / main

Function main

examples/llava/llava-cli.cpp:282–313  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

280}
281
282int main(int argc, char ** argv) {
283 ggml_time_init();
284
285 gpt_params params;
286
287 if (!gpt_params_parse(argc, argv, params)) {
288 show_additional_info(argc, argv);
289 return 1;
290 }
291 if (params.mmproj.empty() || (params.image.empty() && !prompt_contains_image(params.prompt))) {
292 gpt_print_usage(argc, argv, params);
293 show_additional_info(argc, argv);
294 return 1;
295 }
296
297 auto ctx_llava = llava_init(&params);
298 if (ctx_llava == NULL) {
299 fprintf(stderr, "%s: error: failed to init llava\n", __func__);
300 return 1;
301 }
302
303 auto image_embed = load_image(ctx_llava, &params);
304
305 // process the prompt
306 process_prompt(ctx_llava, image_embed, &params, params.prompt);
307
308 llama_print_timings(ctx_llava->ctx_llama);
309
310 llava_image_embed_free(image_embed);
311 llava_free(ctx_llava);
312 return 0;
313}

Callers

nothing calls this directly

Calls 13

gpt_params_parseFunction · 0.85
prompt_contains_imageFunction · 0.85
gpt_print_usageFunction · 0.85
llava_initFunction · 0.85
fprintfFunction · 0.85
load_imageFunction · 0.85
process_promptFunction · 0.85
llama_print_timingsFunction · 0.85
llava_image_embed_freeFunction · 0.85
llava_freeFunction · 0.85
show_additional_infoFunction · 0.70
ggml_time_initFunction · 0.50

Tested by

no test coverage detected