This creates a new context inside a pthread and then tries to exit cleanly.
| 9 | |
| 10 | // This creates a new context inside a pthread and then tries to exit cleanly. |
| 11 | int main(int argc, char ** argv) { |
| 12 | auto * model_path = get_model_or_exit(argc, argv); |
| 13 | |
| 14 | std::thread([&model_path]() { |
| 15 | llama_backend_init(); |
| 16 | auto * model = llama_model_load_from_file(model_path, llama_model_default_params()); |
| 17 | auto * ctx = llama_init_from_model(model, llama_context_default_params()); |
| 18 | llama_free(ctx); |
| 19 | llama_model_free(model); |
| 20 | llama_backend_free(); |
| 21 | }).join(); |
| 22 | |
| 23 | return 0; |
| 24 | } |
nothing calls this directly
no test coverage detected