From 227ef82784b780330093d40e162987bfd6caa41b Mon Sep 17 00:00:00 2001 From: dc-dc-dc Date: Fri, 22 Dec 2023 20:20:18 -0500 Subject: [PATCH] idk why i removed this --- python/src/load.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/src/load.cpp b/python/src/load.cpp index 2590b1821..f6609faea 100644 --- a/python/src/load.cpp +++ b/python/src/load.cpp @@ -244,6 +244,8 @@ DictOrArray mlx_load_helper( std::string fname; if (py::isinstance(file)) { fname = py::cast(file); + } else if (is_istream_object(file)) { + fname = file.attr("name").cast(); } else { throw std::invalid_argument( "[load] Input must be a file-like object, or string");