]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
Warn user if a context size greater than 2048 tokens is specified (#274)
authorRonsor <redacted>
Sun, 19 Mar 2023 00:10:47 +0000 (17:10 -0700)
committerGitHub <redacted>
Sun, 19 Mar 2023 00:10:47 +0000 (20:10 -0400)
LLaMA doesn't support more than 2048 token context sizes, and going above that produces terrible results.

main.cpp

index c88405b82956a9c65a6df32876756fcda2eae95f..105dd91ee60654c173a926a6eee39022fb29c3c1 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -792,6 +792,11 @@ int main(int argc, char ** argv) {
     if (gpt_params_parse(argc, argv, params) == false) {
         return 1;
     }
+    
+    if (params.n_ctx > 2048) {
+        fprintf(stderr, "%s: warning: model does not support context sizes greater than 2048 tokens (%d specified);"
+                "expect poor results\n", __func__, params.n_ctx);
+    }
 
     if (params.seed < 0) {
         params.seed = time(NULL);