From 3f6a118d6adb583f350ac9c3ee670259bdda3e00 Mon Sep 17 00:00:00 2001 From: beiller Date: Sat, 11 Mar 2023 14:24:12 -0500 Subject: [PATCH] Update utils.h --- utils.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/utils.h b/utils.h index bbe8fe8..e331904 100644 --- a/utils.h +++ b/utils.h @@ -16,11 +16,13 @@ struct gpt_params { int32_t seed = -1; // RNG seed int32_t n_threads = std::min(4, (int32_t) std::thread::hardware_concurrency()); int32_t n_predict = 128; // new tokens to predict + int32_t repeat_last_n = 64; // last n tokens to penalize // sampling parameters int32_t top_k = 40; // unused float top_p = 0.95f; float temp = 0.80f; + float repeat_penalty = 1.30f; int32_t n_batch = 8; // batch size for prompt processing @@ -89,6 +91,8 @@ gpt_vocab::id gpt_sample_top_k_top_p( gpt_vocab::id llama_sample_top_p( const gpt_vocab & vocab, const float * logits, + std::vector & last_n_tokens, + double repeat_penalty, double top_p, double temp, std::mt19937 & rng);