Skip to content

torch.load in the runner will throw warning due to ACE security vuln #42

Open
@KyleM73

Description

@KyleM73

torch.load allows arbitrary code execution when the argument weights_only is set to False (default). The default value will switch to True in a future torch release. People wishing to get rid of the error (and eliminate the risk of ACE when loading files you did not train yourself) can change the torch.load call in the runner.load method to include the argument weights_only=True as a default.

Specifically:

def load(self, path, load_optimizer=True):
        loaded_dict = torch.load(path)

should become

def load(self, path, load_optimizer=True):
        loaded_dict = torch.load(path, weights_only=True)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions