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

本站现有博文320篇,共被浏览759195

本站已经建立2427天!

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