pytorch-labs / gpt-fast

Simple and efficient pytorch-native transformer text generation in <1000 LOC of python.
BSD 3-Clause "New" or "Revised" License
5.58k stars 509 forks source link

Use weights_only for load #5

Closed kit1980 closed 10 months ago

kit1980 commented 10 months ago

torch.load without weights_only is unsafe. We probably want to set it to follow best practices as this code will likely be reused.

If weights_only=True doesn't work here, then explicit weights_only=False should be used.

Found with https://github.com/pytorch-labs/torchfix/