aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgi Gerganov <ggerganov@gmail.com>2023-03-17 21:46:46 +0200
committerGeorgi Gerganov <ggerganov@gmail.com>2023-03-17 21:46:46 +0200
commit4f546091102a418ffdc6230f872ac56e5cedb835 (patch)
tree430fc3eb5261769618a32562c06b67d4d93d75bf
parente81b9c81c101f64531ef0fa1ee6b77d562635652 (diff)
Default to 4 threads (#243)
-rw-r--r--utils.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/utils.h b/utils.h
index 5e5b40f..c1a8498 100644
--- a/utils.h
+++ b/utils.h
@@ -14,11 +14,11 @@
struct gpt_params {
int32_t seed = -1; // RNG seed
- int32_t n_threads;
+ 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
int32_t n_ctx = 512; //context size
-
+
// sampling parameters
int32_t top_k = 40;
float top_p = 0.95f;