MCPcopy Create free account
hub / github.com/ml-explore/mlx / is_str_or_path

Function is_str_or_path

python/src/load.cpp:26–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24///////////////////////////////////////////////////////////////////////////////
25
26bool is_str_or_path(nb::object obj) {
27 if (nb::isinstance<nb::str>(obj)) {
28 return true;
29 }
30 nb::object path_type = nb::module_::import_("pathlib").attr("Path");
31 return nb::isinstance(obj, path_type);
32}
33
34bool is_istream_object(const nb::object& file) {
35 return nb::hasattr(file, "readinto") && nb::hasattr(file, "seek") &&

Callers 9

mlx_load_gguf_helperFunction · 0.85
mlx_load_npz_helperFunction · 0.85
mlx_load_npy_helperFunction · 0.85
mlx_load_helperFunction · 0.85
mlx_save_helperFunction · 0.85
mlx_savez_helperFunction · 0.85
mlx_save_gguf_helperFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected