fixes for B007

This commit is contained in:
AUTOMATIC
2023-05-10 11:37:18 +03:00
parent 550256db1c
commit a5121e7a06
28 changed files with 57 additions and 62 deletions

View File

@@ -95,11 +95,11 @@ def check_pt(filename, extra_handler):
except zipfile.BadZipfile:
# if it's not a zip file, it's an olf pytorch format, with five objects written to pickle
# if it's not a zip file, it's an old pytorch format, with five objects written to pickle
with open(filename, "rb") as file:
unpickler = RestrictedUnpickler(file)
unpickler.extra_handler = extra_handler
for i in range(5):
for _ in range(5):
unpickler.load()