diff --git a/model.cpp b/model.cpp index 684317d..7241ff3 100644 --- a/model.cpp +++ b/model.cpp @@ -888,10 +888,9 @@ bool ModelLoader::init_from_safetensors_file(const std::string& file_path, const } } - // ggml/src/ggml.c:2745 - if (n_dims < 1 || n_dims > GGML_MAX_DIMS) { - LOG_ERROR("skip tensor '%s' with n_dims %d", name.c_str(), n_dims); - continue; + // ggml_n_dims returns 1 for scalars + if (n_dims == 0) { + n_dims = 1; } TensorStorage tensor_storage(prefix + name, type, ne, n_dims, file_index, ST_HEADER_SIZE_LEN + header_size_ + begin);