ports/science/linux-ai-ml-env/files/patch-word__language__model_main.py
2025-03-28 15:37:25 +03:00

11 lines
501 B
Python

--- word_language_model/main.py.orig 2025-03-17 17:25:58 UTC
+++ word_language_model/main.py
@@ -243,7 +243,7 @@ with open(args.save, 'rb') as f:
# Load the best saved model.
with open(args.save, 'rb') as f:
- model = torch.load(f)
+ model = torch.load(f, weights_only=False)
# after load the rnn params are not a continuous chunk of memory
# this makes them a continuous chunk, and will speed up forward pass
# Currently, only rnn model supports flatten_parameters function.