Skip to content

Instantly share code, notes, and snippets.

@kohya-ss
kohya-ss / mem_eff_safeopen.py
Last active August 23, 2024 03:41
メインメモリを消費しないsafetensorsファイル読み込み・保存
# License: Apache 2.0
import io
import struct
import json
import torch
class MemoryEfficientSafeOpen:
# does not support metadata loading