add previous function names back in with DEPRECATED notice
This commit is contained in:
parent
4d5356bbbb
commit
bbcbf47b6d
2 changed files with 47 additions and 0 deletions
24
llama.cpp
24
llama.cpp
|
@ -14568,6 +14568,30 @@ void llama_kv_cache_update(struct llama_context * ctx) {
|
||||||
llama_kv_cache_update_internal(*ctx);
|
llama_kv_cache_update_internal(*ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// deprecated
|
||||||
|
size_t llama_get_state_size(const struct llama_context * ctx) {
|
||||||
|
return llama_state_get_size(ctx);
|
||||||
|
}
|
||||||
|
|
||||||
|
// deprecated
|
||||||
|
size_t llama_copy_state_data(struct llama_context * ctx, uint8_t * dst) {
|
||||||
|
return llama_state_get_data(ctx, dst);
|
||||||
|
}
|
||||||
|
|
||||||
|
// deprecated
|
||||||
|
size_t llama_set_state_data(struct llama_context * ctx, const uint8_t * src) {
|
||||||
|
return llama_state_set_data(ctx, src);
|
||||||
|
}
|
||||||
|
|
||||||
|
// deprecated
|
||||||
|
bool llama_load_session_file(struct llama_context * ctx, const char * path_session, llama_token * tokens_out, size_t n_token_capacity, size_t * n_token_count_out) {
|
||||||
|
return llama_state_load_file(ctx, path_session, tokens_out, n_token_capacity, n_token_count_out);
|
||||||
|
}
|
||||||
|
|
||||||
|
// deprecated
|
||||||
|
bool llama_save_session_file(struct llama_context * ctx, const char * path_session, const llama_token * tokens, size_t n_token_count) {
|
||||||
|
return llama_state_save_file(ctx, path_session, tokens, n_token_count);
|
||||||
|
}
|
||||||
|
|
||||||
// Returns the *maximum* size of the state
|
// Returns the *maximum* size of the state
|
||||||
size_t llama_state_get_size(const struct llama_context * ctx) {
|
size_t llama_state_get_size(const struct llama_context * ctx) {
|
||||||
|
|
23
llama.h
23
llama.h
|
@ -595,6 +595,8 @@ extern "C" {
|
||||||
// Returns the maximum size in bytes of the state (rng, logits, embedding
|
// Returns the maximum size in bytes of the state (rng, logits, embedding
|
||||||
// and kv_cache) - will often be smaller after compacting tokens
|
// and kv_cache) - will often be smaller after compacting tokens
|
||||||
LLAMA_API size_t llama_state_get_size(const struct llama_context * ctx);
|
LLAMA_API size_t llama_state_get_size(const struct llama_context * ctx);
|
||||||
|
LLAMA_API DEPRECATED(size_t llama_get_state_size(const struct llama_context * ctx),
|
||||||
|
"use llama_state_get_size instead");
|
||||||
|
|
||||||
// Copies the state to the specified destination address.
|
// Copies the state to the specified destination address.
|
||||||
// Destination needs to have allocated enough memory.
|
// Destination needs to have allocated enough memory.
|
||||||
|
@ -602,12 +604,20 @@ extern "C" {
|
||||||
LLAMA_API size_t llama_state_get_data(
|
LLAMA_API size_t llama_state_get_data(
|
||||||
struct llama_context * ctx,
|
struct llama_context * ctx,
|
||||||
uint8_t * dst);
|
uint8_t * dst);
|
||||||
|
LLAMA_API DEPRECATED(size_t llama_copy_state_data(
|
||||||
|
struct llama_context * ctx,
|
||||||
|
uint8_t * dst),
|
||||||
|
"use llama_state_get_data instead");
|
||||||
|
|
||||||
// Set the state reading from the specified address
|
// Set the state reading from the specified address
|
||||||
// Returns the number of bytes read
|
// Returns the number of bytes read
|
||||||
LLAMA_API size_t llama_state_set_data(
|
LLAMA_API size_t llama_state_set_data(
|
||||||
struct llama_context * ctx,
|
struct llama_context * ctx,
|
||||||
const uint8_t * src);
|
const uint8_t * src);
|
||||||
|
LLAMA_API DEPRECATED(size_t llama_set_state_data(
|
||||||
|
struct llama_context * ctx,
|
||||||
|
const uint8_t * src),
|
||||||
|
"use llama_state_set_data instead");
|
||||||
|
|
||||||
// Save/load session file
|
// Save/load session file
|
||||||
LLAMA_API bool llama_state_load_file(
|
LLAMA_API bool llama_state_load_file(
|
||||||
|
@ -616,12 +626,25 @@ extern "C" {
|
||||||
llama_token * tokens_out,
|
llama_token * tokens_out,
|
||||||
size_t n_token_capacity,
|
size_t n_token_capacity,
|
||||||
size_t * n_token_count_out);
|
size_t * n_token_count_out);
|
||||||
|
LLAMA_API DEPRECATED(bool llama_load_session_file(
|
||||||
|
struct llama_context * ctx,
|
||||||
|
const char * path_session,
|
||||||
|
llama_token * tokens_out,
|
||||||
|
size_t n_token_capacity,
|
||||||
|
size_t * n_token_count_out),
|
||||||
|
"use llama_state_load_file instead");
|
||||||
|
|
||||||
LLAMA_API bool llama_state_save_file(
|
LLAMA_API bool llama_state_save_file(
|
||||||
struct llama_context * ctx,
|
struct llama_context * ctx,
|
||||||
const char * path_session,
|
const char * path_session,
|
||||||
const llama_token * tokens,
|
const llama_token * tokens,
|
||||||
size_t n_token_count);
|
size_t n_token_count);
|
||||||
|
LLAMA_API DEPRECATED(bool llama_save_session_file(
|
||||||
|
struct llama_context * ctx,
|
||||||
|
const char * path_session,
|
||||||
|
const llama_token * tokens,
|
||||||
|
size_t n_token_count),
|
||||||
|
"use llama_state_save_file instead");
|
||||||
|
|
||||||
LLAMA_API size_t llama_state_seq_get_size(
|
LLAMA_API size_t llama_state_seq_get_size(
|
||||||
struct llama_context * ctx,
|
struct llama_context * ctx,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue