summaryrefslogtreecommitdiff
path: root/llama.cpp
diff options
context:
space:
mode:
authorMarian Cepok <marian.cepok@gmail.com>2023-04-02 12:21:31 +0200
committerGitHub <noreply@github.com>2023-04-02 13:21:31 +0300
commitc0bb1d3ce21005ab21d686626ba87261a6e3a660 (patch)
treeb2892bed5a3e233d7779d4c0fe37cbf8b6fb0ca1 /llama.cpp
parent6e7801d08d81c931a5427bae46f00763e993f54a (diff)
ggml : change ne to int64_t (#626)
Diffstat (limited to 'llama.cpp')
-rw-r--r--llama.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llama.cpp b/llama.cpp
index 1b3157cd..b0f53ca6 100644
--- a/llama.cpp
+++ b/llama.cpp
@@ -256,8 +256,8 @@ static bool kv_cache_init(
const int n_embd = hparams.n_embd;
const int n_layer = hparams.n_layer;
- const int n_mem = n_layer*n_ctx;
- const int n_elements = n_embd*n_mem;
+ const int64_t n_mem = (int64_t)n_layer*n_ctx;
+ const int64_t n_elements = n_embd*n_mem;
cache.buf.resize(2u*n_elements*ggml_type_size(wtype) + 2u*MB);
@@ -679,7 +679,7 @@ static bool llama_model_load(
return false;
}
if (tensor->ne[0] != ne[0] || tensor->ne[1] != ne[1]) {
- fprintf(stderr, "%s: tensor '%s' has wrong shape in model file: got [%d, %d], expected [%d, %d]\n",
+ fprintf(stderr, "%s: tensor '%s' has wrong shape in model file: got [%" PRId64 ", %" PRId64 "], expected [%d, %d]\n",
__func__, name.data(), tensor->ne[0], tensor->ne[1], ne[0], ne[1]);
return false;
}