diff --git a/main.cpp b/main.cpp index ca0fca8b36455..0c17b30354489 100644 --- a/main.cpp +++ b/main.cpp @@ -549,9 +549,7 @@ bool llama_eval( const int d_key = n_embd/n_head; - // TODO: check if this size scales with n_ctx linearly and remove constant. somehow I feel it wasn't the case - // static size_t buf_size = hparams.n_ctx*1024*1024; - static size_t buf_size = 512u*1024*1024; + static size_t buf_size = (size_t)hparams.n_ctx*1024*1024; static void * buf = malloc(buf_size); if (mem_per_token > 0 && mem_per_token*N > buf_size) {