as title
Right now the process is to keep doing this until the torch.load eventually succeeds
torch.load(f, weights_only=True)
# Fails with Unsupported GLOBAL: {bla} ... and says to use `add_safe_globals` if it is safe
torch.add_safe_globals([bla])
We should see whether we can get all the GLOBALs in the checkpoint in one go in an efficient manner to make the process more low friction. Not sure whether this is possible without code execution though.
A possibility is that we could parse the pickletools.dis("data.pkl") for GLOBAL
Thanks @vmoens for suggesting this :)
Versions
main
cc @mruberry