From f0e55ee3c66b1247a9ed9c793bb63a095045c213 Mon Sep 17 00:00:00 2001 From: niansa Date: Sun, 23 Apr 2023 22:40:55 +0200 Subject: [PATCH] Added context size config key --- example_config.txt | 1 + main.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/example_config.txt b/example_config.txt index 91bf26c..4f5a528 100644 --- a/example_config.txt +++ b/example_config.txt @@ -8,3 +8,4 @@ mlock false pool_size 2 threads 4 persistance true +ctx_size 1012 diff --git a/main.cpp b/main.cpp index 3080083..02ee697 100644 --- a/main.cpp +++ b/main.cpp @@ -168,7 +168,7 @@ class Bot { LM::Inference::Params llm_get_params() const { return { .n_threads = int(config.threads), - .n_ctx = 1012, + .n_ctx = int(config.ctx_size), .n_repeat_last = 256, .temp = 0.3f, .repeat_penalty = 1.372222224f, @@ -344,7 +344,8 @@ public: language = "EN", inference_model = "13B-ggml-model-quant.bin", translation_model = "13B-ggml-model-quant.bin"; - unsigned pool_size = 2, + unsigned ctx_size = 1012, + pool_size = 2, threads = 4, persistance = true; bool mlock = false; @@ -466,6 +467,8 @@ int main(int argc, char **argv) { cfg.pool_size = std::stoi(value); } else if (key == "threads") { cfg.threads = std::stoi(value); + } else if (key == "ctx_size") { + cfg.ctx_size = std::stoi(value); } else if (key == "mlock") { cfg.mlock = (value=="true")?true:false; } else if (key == "persistance") {