Update utils.h

This commit is contained in:
beiller 2023-03-11 14:24:12 -05:00 committed by GitHub
parent d2b96b5593
commit 3f6a118d6a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,11 +16,13 @@ struct gpt_params {
int32_t seed = -1; // RNG seed int32_t seed = -1; // RNG seed
int32_t n_threads = std::min(4, (int32_t) std::thread::hardware_concurrency()); int32_t n_threads = std::min(4, (int32_t) std::thread::hardware_concurrency());
int32_t n_predict = 128; // new tokens to predict int32_t n_predict = 128; // new tokens to predict
int32_t repeat_last_n = 64; // last n tokens to penalize
// sampling parameters // sampling parameters
int32_t top_k = 40; // unused int32_t top_k = 40; // unused
float top_p = 0.95f; float top_p = 0.95f;
float temp = 0.80f; float temp = 0.80f;
float repeat_penalty = 1.30f;
int32_t n_batch = 8; // batch size for prompt processing 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( gpt_vocab::id llama_sample_top_p(
const gpt_vocab & vocab, const gpt_vocab & vocab,
const float * logits, const float * logits,
std::vector<gpt_vocab::id> & last_n_tokens,
double repeat_penalty,
double top_p, double top_p,
double temp, double temp,
std::mt19937 & rng); std::mt19937 & rng);