fix: load safetensors index shards without recursion (#2058)

This commit is contained in:
leejet 2026-09-25 16:40:20 +08:00 committed by GitHub
parent 510bccf330
commit 4c3cf7543d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -322,7 +322,13 @@ bool ModelLoader::init_from_safetensors_index_file(const std::string& file_path,
} }
for (const std::string& shard_path : shard_paths) { for (const std::string& shard_path : shard_paths) {
if (!parse_file(shard_path, prefix)) { FileStamp stamp;
if (!read_file_stamp(shard_path, stamp)) {
return false;
}
parsed_dependencies_.push_back(stamp);
LOG_INFO("load %s using safetensors format", shard_path.c_str());
if (!init_from_safetensors_file(shard_path, prefix)) {
return false; return false;
} }
} }