You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Safetensors is used by some other crates, and some of them support no_std feature, for example, the dfdx, however, currently safetensors do not support no_std, so people cannot use dfdx to export model at no_std environment.
Your contribution
Currently I make a patch in my own git repository, adding a no_std feature and:
when enable no_std, swtich from HashMap to hashbrown::HashMap
change some types or macros from std to alloc:
String => alloc::string::String
format! => alloc::format!
Vec => alloc::vec::Vec
vec! => alloc::vec!
std::borrow::Cow => alloc::borrow::Cow
change some traits or types from std to core:
std::ops => core::ops
std::fmt::Display => core::fmt::Display
std::error::Error => core::error::Error
std::str => core::str
switch serde and serde_json to no_std
when enable, remove some dependencies of std:
remove the IoError in std::io::Error
remove methods that loads from or writes to file (serialize_to_file)
I would like to create a PR if you allow.
The text was updated successfully, but these errors were encountered:
Feature request
make safetensors crate support no_std feature.
Motivation
Safetensors is used by some other crates, and some of them support no_std feature, for example, the dfdx, however, currently safetensors do not support no_std, so people cannot use dfdx to export model at no_std environment.
Your contribution
Currently I make a patch in my own git repository, adding a no_std feature and:
String => alloc::string::String
format! => alloc::format!
Vec => alloc::vec::Vec
vec! => alloc::vec!
std::borrow::Cow => alloc::borrow::Cow
std::ops => core::ops
std::fmt::Display => core::fmt::Display
std::error::Error => core::error::Error
std::str => core::str
serialize_to_file
)I would like to create a PR if you allow.
The text was updated successfully, but these errors were encountered: