Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions mlx/io/safetensors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ using json = nlohmann::json;
#define ST_U32 "U32"
#define ST_U64 "U64"
#define ST_F8_E4M3 "F8_E4M3"
#define ST_F8_E8M0 "F8_E8M0"

// Note: Complex numbers aren't in the spec yet so this could change -
// https://github.com/huggingface/safetensors/issues/389
Expand Down Expand Up @@ -97,6 +98,8 @@ Dtype dtype_from_safetensor_str(std::string_view str) {
return complex64;
} else if (str == ST_F8_E4M3) {
return uint8;
} else if (str == ST_F8_E8M0) {
return uint8;
} else {
std::ostringstream msg;
msg << "[safetensor] unsupported dtype" << str;
Expand Down
Loading