Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
:slightly_smiling_face: Simple, safe way to store and distribute tensors
Add this line to your application’s Gemfile:
gem "safetensors"
Save tensors
tensors = {
"weight1" => Torch.zeros([1024, 1024]),
"weight2" => Torch.zeros([1024, 1024])
}
Safetensors::Torch.save_file(tensors, "model.safetensors")
Load tensors
tensors = Safetensors::Torch.load_file("model.safetensors")
# or
tensors = {}
Safetensors.safe_open("model.safetensors", framework: "torch", device: "cpu") do |f|
f.keys.each do |key|
tensors[key] = f.get_tensor(key)
end
end
This library follows the Safetensors Python API. You can follow Python tutorials and convert the code to Ruby in many cases. Feel free to open an issue if you run into problems.
View the changelog
Everyone is encouraged to help improve this project. Here are a few ways you can help:
To get started with development:
git clone https://github.com/ankane/safetensors-ruby.git
cd safetensors-ruby
bundle install
bundle exec rake compile
bundle exec rake test
FAQs
Unknown package
We found that safetensors demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.