-
Notifications
You must be signed in to change notification settings - Fork 72
[IR] Support safetensors in tensor adapters #1933
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
Conversation
❌ 93 Tests Failed:
View the top 3 failed tests by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
self._path = path | ||
self._tensor_name = tensor_name | ||
|
||
with safetensors.safe_open(path, framework="numpy") as f: |
Check failure
Code scanning / lintrunner
MYPY/attr-defined Error
self._path = path | ||
self._tensor_name = tensor_name | ||
|
||
with safetensors.safe_open(path, framework="numpy") as f: |
Check failure
Code scanning / lintrunner
MYPY/attr-defined Error
Supported in https://github.com/justinchuby/onnx-safetensors instead |
Load safetensors as numpy arrays. It is actually incredibly easy and we are able to reuse the
ir.Tensor
implementation because the numpy array loaded by safetensors is memory mapped. We can use it as a normal numpy array without memory constraints.TODO