| 2612 | } |
| 2613 | |
| 2614 | bool llama_state_load_file(llama_context * ctx, const char * path_session, llama_token * tokens_out, size_t n_token_capacity, size_t * n_token_count_out) { |
| 2615 | ctx->synchronize(); |
| 2616 | |
| 2617 | try { |
| 2618 | return ctx->state_load_file(path_session, tokens_out, n_token_capacity, n_token_count_out); |
| 2619 | } catch (const std::exception & err) { |
| 2620 | LLAMA_LOG_ERROR("%s: error loading session file: %s\n", __func__, err.what()); |
| 2621 | return false; |
| 2622 | } |
| 2623 | } |
| 2624 | |
| 2625 | bool llama_state_save_file(llama_context * ctx, const char * path_session, const llama_token * tokens, size_t n_token_count) { |
| 2626 | ctx->synchronize(); |
no test coverage detected