Skip to content

Commit c2d7c0c

Browse files
committed
Merge branch 'master' into ays
2 parents 36abf47 + 760cfaa commit c2d7c0c

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

ggml_extend.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ __STATIC_INLINE__ void sd_tiling(ggml_tensor* input, ggml_tensor* output, const
454454
ggml_tensor* input_tile = ggml_new_tensor_4d(tiles_ctx, GGML_TYPE_F32, tile_size, tile_size, input->ne[2], 1);
455455
ggml_tensor* output_tile = ggml_new_tensor_4d(tiles_ctx, GGML_TYPE_F32, tile_size * scale, tile_size * scale, output->ne[2], 1);
456456
on_processing(input_tile, NULL, true);
457-
int num_tiles = (input_width * input_height) / (non_tile_overlap * non_tile_overlap);
457+
int num_tiles = ceil((float)input_width / non_tile_overlap) * ceil((float)input_height / non_tile_overlap);
458458
LOG_INFO("processing %i tiles", num_tiles);
459459
pretty_progress(1, num_tiles, 0.0f);
460460
int tile_count = 1;

model.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -888,6 +888,11 @@ bool ModelLoader::init_from_safetensors_file(const std::string& file_path, const
888888
}
889889
}
890890

891+
// ggml/src/ggml.c:2745
892+
if (n_dims < 1 || n_dims > GGML_MAX_DIMS) {
893+
continue;
894+
}
895+
891896
TensorStorage tensor_storage(prefix + name, type, ne, n_dims, file_index, ST_HEADER_SIZE_LEN + header_size_ + begin);
892897
tensor_storage.reverse_ne();
893898

0 commit comments

Comments
 (0)