Skip to content

Latest commit

 

History

History
7 lines (6 loc) · 661 Bytes

README.md

File metadata and controls

7 lines (6 loc) · 661 Bytes

A safer unpickle class for the new age of community-owned checkpoint!

safer_unpickle is a single-file python library which provides several functions

  • A core function of loading python pickles using whitelist-guarded class path resolver which fails on forbidden paths
  • A function to patch native torch.load method at runtime, thus giving a measure of security to existing pytorch applications, for example to forks of stable-diffusion
  • Integrated tool to check checkpoints for class whitelist adherence
  • As a bonus, the library includes a shim for pytorch_lightning to avoid requiring it at runtime for checkpoints that were trained with it in their env