Views
No views yet
load_custom_state() function which explicitly uses weights_only=False.accelerator.load_state(), the pickle payload executes
arbitrary code before any validation.1def load_custom_state(obj, path, index: int = 0):
2 load_location = f"{path}/custom_checkpoint_{index}.pkl"
3 obj.load_state_dict(load(load_location, map_location="cpu", weights_only=False))