diff options
author | Marcus Dunn <51931484+MarcusDunn@users.noreply.github.com> | 2024-02-29 00:17:23 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-29 10:17:23 +0200 |
commit | d5ab29757ebc59a30f03e408294ec20628a6374e (patch) | |
tree | 4c5ee7499d67d264f913fbc41a2df2ad6cf1612e | |
parent | 87c91c07663b707e831c59ec373b5e665ff9d64a (diff) |
llama : constified `llama_set_state_data`'s `src` (#5774)
-rw-r--r-- | llama.cpp | 6 | ||||
-rw-r--r-- | llama.h | 2 |
2 files changed, 4 insertions, 4 deletions
@@ -12545,8 +12545,8 @@ size_t llama_copy_state_data(struct llama_context * ctx, uint8_t * dst) { } // Sets the state reading from the specified source address -size_t llama_set_state_data(struct llama_context * ctx, uint8_t * src) { - uint8_t * inp = src; +size_t llama_set_state_data(struct llama_context * ctx, const uint8_t * src) { + const uint8_t * inp = src; // set rng { @@ -12555,7 +12555,7 @@ size_t llama_set_state_data(struct llama_context * ctx, uint8_t * src) { GGML_ASSERT(rng_size <= LLAMA_MAX_RNG_STATE); - std::string rng_str((char *)inp, rng_size); inp += rng_size; + std::string rng_str((const char *)inp, rng_size); inp += rng_size; std::istringstream rng_ss(rng_str); rng_ss >> ctx->rng; @@ -575,7 +575,7 @@ extern "C" { // Returns the number of bytes read LLAMA_API size_t llama_set_state_data( struct llama_context * ctx, - uint8_t * src); + const uint8_t * src); // Save/load session file LLAMA_API bool llama_load_session_file( |