| 280 | } |
| 281 | |
| 282 | int 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(¶ms); |
| 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, ¶ms); |
| 304 | |
| 305 | // process the prompt |
| 306 | process_prompt(ctx_llava, image_embed, ¶ms, 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 | } |
nothing calls this directly
no test coverage detected