mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2025-02-09 09:48:16 +01:00
llama : constified llama_set_state_data
's src
(#5774)
This commit is contained in:
parent
87c91c0766
commit
d5ab29757e
@ -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
|
// Sets the state reading from the specified source address
|
||||||
size_t llama_set_state_data(struct llama_context * ctx, uint8_t * src) {
|
size_t llama_set_state_data(struct llama_context * ctx, const uint8_t * src) {
|
||||||
uint8_t * inp = src;
|
const uint8_t * inp = src;
|
||||||
|
|
||||||
// set rng
|
// 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);
|
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);
|
std::istringstream rng_ss(rng_str);
|
||||||
rng_ss >> ctx->rng;
|
rng_ss >> ctx->rng;
|
||||||
|
2
llama.h
2
llama.h
@ -575,7 +575,7 @@ extern "C" {
|
|||||||
// Returns the number of bytes read
|
// Returns the number of bytes read
|
||||||
LLAMA_API size_t llama_set_state_data(
|
LLAMA_API size_t llama_set_state_data(
|
||||||
struct llama_context * ctx,
|
struct llama_context * ctx,
|
||||||
uint8_t * src);
|
const uint8_t * src);
|
||||||
|
|
||||||
// Save/load session file
|
// Save/load session file
|
||||||
LLAMA_API bool llama_load_session_file(
|
LLAMA_API bool llama_load_session_file(
|
||||||
|
Loading…
Reference in New Issue
Block a user