Merge branch 'master' into concedo_experimental

This commit is contained in:
Concedo 2023-06-30 23:25:40 +08:00
commit 67cb0b2760
10 changed files with 25 additions and 23 deletions

View file

@ -778,7 +778,7 @@ static bool kv_cache_init(
struct llama_context_params llama_context_default_params() {
struct llama_context_params result = {
/*.seed =*/ -1,
/*.seed =*/ LLAMA_DEFAULT_SEED,
/*.n_ctx =*/ 512,
/*.n_batch =*/ 512,
/*.gpu_layers =*/ 0,
@ -2541,7 +2541,7 @@ struct llama_context * llama_new_context_with_model(
llama_context * ctx = new llama_context(*model, model->vocab);
if (params.seed < 0) {
if (params.seed == LLAMA_DEFAULT_SEED) {
params.seed = time(NULL);
}
@ -2975,8 +2975,8 @@ int llama_get_kv_cache_token_count(const struct llama_context * ctx) {
#define LLAMA_MAX_RNG_STATE (64*1024)
void llama_set_rng_seed(struct llama_context * ctx, int seed) {
if (seed < 0) {
void llama_set_rng_seed(struct llama_context * ctx, uint32_t seed) {
if (seed == LLAMA_DEFAULT_SEED) {
seed = time(NULL);
}
ctx->rng.seed(seed);