Set weights_only in torch.load (#36991)
This commit is contained in:
@@ -765,7 +765,7 @@ class ModelUtilsTest(TestCasePlus):
|
||||
# Note: pickle adds some junk so the weight of the file can end up being slightly bigger than
|
||||
# the size asked for (since we count parameters)
|
||||
if size >= max_size_int + 50000:
|
||||
state_dict = torch.load(shard_file)
|
||||
state_dict = torch.load(shard_file, weights_only=True)
|
||||
self.assertEqual(len(state_dict), 1)
|
||||
|
||||
# Check the index and the shard files found match
|
||||
|
||||
Reference in New Issue
Block a user