Skip to content

Commit d7def1a

Browse files
authored
Warn user if a context size greater than 2048 tokens is specified (#274)
LLaMA doesn't support more than 2048 token context sizes, and going above that produces terrible results.
1 parent 6f61c18 commit d7def1a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

main.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,11 @@ int main(int argc, char ** argv) {
792792
if (gpt_params_parse(argc, argv, params) == false) {
793793
return 1;
794794
}
795+
796+
if (params.n_ctx > 2048) {
797+
fprintf(stderr, "%s: warning: model does not support context sizes greater than 2048 tokens (%d specified);"
798+
"expect poor results\n", __func__, params.n_ctx);
799+
}
795800

796801
if (params.seed < 0) {
797802
params.seed = time(NULL);

0 commit comments

Comments
 (0)