mirror of
https://github.com/ml-explore/mlx.git
synced 2025-08-21 20:38:07 +08:00
ignore __metadata__
This commit is contained in:
parent
f4d876d35f
commit
801c1ad3a4
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user