ignore __metadata__

This commit is contained in:
dc-dc-dc 2023-12-18 17:18:55 -05:00
parent f4d876d35f
commit 801c1ad3a4

View File

@ -288,6 +288,10 @@ std::unordered_map<std::string, array> load_safetensor(
// Load the arrays using metadata // Load the arrays using metadata
std::unordered_map<std::string, array> res; std::unordered_map<std::string, array> res;
for (auto& [key, obj] : *metadata.getObject()) { for (auto& [key, obj] : *metadata.getObject()) {
if (key == "__metadata__") {
// ignore metadata for now
continue;
}
std::string dtype = obj->getObject()->at("dtype")->getString(); std::string dtype = obj->getObject()->at("dtype")->getString();
auto shape = obj->getObject()->at("shape")->getList(); auto shape = obj->getObject()->at("shape")->getList();
std::vector<int> shape_vec; std::vector<int> shape_vec;