diff --git a/model.cpp b/model.cpp index 24da39f6..1235a5cf 100644 --- a/model.cpp +++ b/model.cpp @@ -99,7 +99,7 @@ const char* unused_tensors[] = { }; bool is_unused_tensor(std::string name) { - for (int i = 0; i < sizeof(unused_tensors) / sizeof(const char*); i++) { + for (size_t i = 0; i < sizeof(unused_tensors) / sizeof(const char*); i++) { if (starts_with(name, unused_tensors[i])) { return true; } diff --git a/model.h b/model.h index d7f97653..5fe3ad55 100644 --- a/model.h +++ b/model.h @@ -97,7 +97,7 @@ struct TensorStorage { size_t file_index = 0; int index_in_zip = -1; // >= means stored in a zip file - size_t offset = 0; // offset in file + uint64_t offset = 0; // offset in file TensorStorage() = default; @@ -140,10 +140,10 @@ struct TensorStorage { std::vector chunk(size_t n) { std::vector chunks; - size_t chunk_size = nbytes_to_read() / n; + uint64_t chunk_size = nbytes_to_read() / n; // printf("%d/%d\n", chunk_size, nbytes_to_read()); reverse_ne(); - for (int i = 0; i < n; i++) { + for (size_t i = 0; i < n; i++) { TensorStorage chunk_i = *this; chunk_i.ne[0] = ne[0] / n; chunk_i.offset = offset + i * chunk_size;