diff options
author | Ásgeir Bjarni Ingvarsson <asgeir@fundinn.org> | 2023-04-26 20:08:43 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-26 22:08:43 +0200 |
commit | 87a6f846d3e929632c45916dd08f1e2a9c72d2a3 (patch) | |
tree | 3f7dbad866c710048a066704ec5d9af4ab34feb2 /llama.h | |
parent | ea3ad7eb60cfb44526a58122e8019850f437cd1b (diff) |
Allow setting the rng seed after initialization. (#1184)
The llama_set_state_data function restores the rng state to what it
was at the time llama_copy_state_data was called. But users may want
to restore the state and proceed with a different seed.
Diffstat (limited to 'llama.h')
-rw-r--r-- | llama.h | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -116,6 +116,9 @@ extern "C" { // Returns the number of tokens in the KV cache LLAMA_API int llama_get_kv_cache_token_count(struct llama_context * ctx); + // Sets the current rng seed. + LLAMA_API void llama_set_rng_seed(struct llama_context * ctx, int seed); + // Returns the size in bytes of the state (rng, logits, embedding and kv_cache) LLAMA_API size_t llama_get_state_size(struct llama_context * ctx); |