awslabs / sockeye

Sequence-to-sequence framework with a focus on Neural Machine Translation based on PyTorch
https://awslabs.github.io/sockeye/
Apache License 2.0
1.21k stars 323 forks source link

Use `weights_only=True` when loading SockeyeModel parameters. #1112

Closed mjdenkowski closed 6 months ago

mjdenkowski commented 6 months ago

Use weights_only=True when loading SockeyeModel parameters. From torch.load documentation:

torch.load() unless weights_only parameter is set to True, uses pickle module implicitly, which is known to be insecure.

Pull Request Checklist

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

mjdenkowski commented 6 months ago

It looks like macos-latest no longer supports Python versions 3.7 and 3.8. I've set our checks to use macos-12, which supports both.