-
Notifications
You must be signed in to change notification settings - Fork 441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support importing safetensors format #626
Comments
I think natively we should stick to the file format we have currently, primarily because it's difficult to maintain many formats. We already support JSON (for visual debugging), Bincode (for embedding data), and MessagePack (for long-term and cross-language support). However, we should support file conversion from other formats, such as I also would like for us to build a tool to do basic structure conversion. What I mean by that is we need some ability to remap field names and also change the depth/level of field nodes. |
Hi, is there any timeline for this feature? Given the large number of |
Not yet, but we may implement this sonner rather than later |
@nathanielsimard it would be easy to do now that PyTorchFileRecorder works nicely. We just need to do the same things but using safetensors reader which is available from Candle. |
Safetensors (de)serialization
Feature description
Load, at either tensor- or module-level, weights from a
.safetensors
file.Feature motivation
To be able to tap into the huggingface ecosystem it would be useful to have the ability to (de)serialize for
safetensors
. This would obviously have the limitation of these files merely containing a key-value JSON for all weights, and no description of the model's topology/architecture just like ONNX does. Ideally this would help grow the Model Zoo.This would then mostly be a convenience feature, both for sharing and using existing models.
(Optional) Suggest a Solution
Possibly we could start by deriving the
TryFrom
trait for theirTensorView
and ourTensor
and take it from there. Huggingface'scandle
(Rust) framework already has the capability to (de)serialize from.safetensors
.The text was updated successfully, but these errors were encountered: