EADST

Safetensors: Safe and Efficient Tensor Storage

Safetensors is a library for safely and efficiently saving and loading PyTorch tensors. Unlike traditional formats like pickle, Safetensors is designed to prevent arbitrary code execution, offering a more secure way to handle tensor data.

import torch
from safetensors import save_file, load_file

# Create a tensor
tensor = torch.rand(3, 3)

# Save the tensor
save_file({"tensor": tensor}, "tensor_data.safetensors")

# Load the tensor
loaded_tensors = load_file("tensor_data.safetensors")
loaded_tensor = loaded_tensors["tensor"]
相关标签
About Me
XD
Goals determine what you are going to be.
Category
标签云
Qwen2.5 Numpy CSV Michelin 签证 git Sklearn FlashAttention 版权 Python HaggingFace 阿里云 Plotly Crawler CV 继承 XGBoost 公式 LaTeX PIP llama.cpp Quantize Bert Quantization Vmess CTC NameSilo 多线程 CAM Ptyhon 算法题 IndexTTS2 tqdm Statistics CC tar BF16 DeepStream Paper Linux Image2Text Color Conda Zip Claude Translation GoogLeNet 云服务器 RL Nginx VGG-16 EXCEL Augmentation Domain PyTorch Random Heatmap Datetime Base64 Animate Git Math Miniforge SQL WAN uwsgi 关于博主 Proxy Qwen2 Hungarian v0.dev Distillation BeautifulSoup Safetensors TTS scipy MD5 uWSGI ResNet-50 ModelScope Qwen CUDA 财报 Jupyter TensorRT Hilton ms-swift DeepSeek FP32 CEIR 论文速读 Video Rebuttal Transformers GPT4 Django Search Github Llama Baidu Disk LeetCode Ubuntu Permission RAR Anaconda OCR mmap Pytorch Streamlit Bipartite Vim 净利润 Diagram InvalidArgumentError Freesound UNIX Data FP64 强化学习 JSON Pandas Windows Paddle Jetson Tensor 图标 VSCode FP8 Clash PyCharm git-lfs XML SQLite RGB NLP C++ ONNX Mixtral BTC hf Plate Land ChatGPT 自我改进 Pickle Card PDF Dataset TSV Firewall Tiktoken 证件照 News 多进程 TensorFlow Web 第一性原理 LLAMA Interview CLAP HuggingFace 搞笑 论文 顶会 Food Algorithm Use Jev QWEN Agent NLTK LoRA API网关 FastAPI Excel icon Website Gemma Hotel Harness GIT Breakpoint diffusers Bin YOLO WebCrawler v2ray Magnet SPIE PDB printf Google 腾讯云 GPTQ 图形思考法 Attention Input 域名 VPN Tracking SAM 报税 COCO 递归学习法 Logo Review 飞书 Knowledge 个人博客 OpenAI Cloudreve Password logger LLM transformers SVR OpenCV 长期记忆 Bitcoin Pillow AI Template GGML FP16 torchinfo 音频 Markdown UI Shortcut API Docker
站点统计

本站现有博文340篇,共被浏览1019366次

本站已经建立2719天!

热门文章
文章归档
回到顶部