}
// 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
{
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;
// 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(