@@ -18073,7 +18073,7 @@ struct gguf_context * gguf_init_from_file(const char * fname, struct gguf_init_p
18073
18073
{
18074
18074
ctx->kv = malloc(ctx->header.n_kv * sizeof(struct gguf_kv));
18075
18075
18076
- for (uint32_t i = 0; i < ctx->header.n_kv; ++i) {
18076
+ for (uint64_t i = 0; i < ctx->header.n_kv; ++i) {
18077
18077
struct gguf_kv * kv = &ctx->kv[i];
18078
18078
18079
18079
//fprintf(stderr, "%s: reading kv %d\n", __func__, i);
@@ -18120,7 +18120,7 @@ struct gguf_context * gguf_init_from_file(const char * fname, struct gguf_init_p
18120
18120
case GGUF_TYPE_STRING:
18121
18121
{
18122
18122
kv->value.arr.data = malloc(kv->value.arr.n * sizeof(struct gguf_str));
18123
- for (uint32_t j = 0; j < kv->value.arr.n; ++j) {
18123
+ for (uint64_t j = 0; j < kv->value.arr.n; ++j) {
18124
18124
ok = ok && gguf_fread_str(file, &((struct gguf_str *) kv->value.arr.data)[j], &offset);
18125
18125
}
18126
18126
} break;
@@ -18148,7 +18148,7 @@ struct gguf_context * gguf_init_from_file(const char * fname, struct gguf_init_p
18148
18148
{
18149
18149
ctx->infos = malloc(ctx->header.n_tensors * sizeof(struct gguf_tensor_info));
18150
18150
18151
- for (uint32_t i = 0; i < ctx->header.n_tensors; ++i) {
18151
+ for (uint64_t i = 0; i < ctx->header.n_tensors; ++i) {
18152
18152
struct gguf_tensor_info * info = &ctx->infos[i];
18153
18153
18154
18154
for (int j = 0; j < GGML_MAX_DIMS; ++j) {
@@ -18195,7 +18195,7 @@ struct gguf_context * gguf_init_from_file(const char * fname, struct gguf_init_p
18195
18195
// compute the total size of the data section, taking into account the alignment
18196
18196
{
18197
18197
ctx->size = 0;
18198
- for (uint32_t i = 0; i < ctx->header.n_tensors; ++i) {
18198
+ for (uint64_t i = 0; i < ctx->header.n_tensors; ++i) {
18199
18199
struct gguf_tensor_info * info = &ctx->infos[i];
18200
18200
18201
18201
const int64_t ne =
@@ -18264,7 +18264,7 @@ struct gguf_context * gguf_init_from_file(const char * fname, struct gguf_init_p
18264
18264
ggml_set_no_alloc(ctx_data, true);
18265
18265
18266
18266
// create the tensors
18267
- for (uint32_t i = 0; i < ctx->header.n_tensors; ++i) {
18267
+ for (uint64_t i = 0; i < ctx->header.n_tensors; ++i) {
18268
18268
const int64_t ne[GGML_MAX_DIMS] = {
18269
18269
ctx->infos[i].ne[0],
18270
18270
ctx->infos[i].ne[1],
0 commit comments