-
Notifications
You must be signed in to change notification settings - Fork 54
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
[IR] Support safetensors in tensor adapters #1933
base: main
Are you sure you want to change the base?
Conversation
❌ 13 Tests Failed:
View the full list of 3 ❄️ flaky tests
To view individual test run time comparison to the main branch, 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
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