python3Packages.torchsnapshot: fix torch.load call (#423123)
This commit is contained in:
commit
0826f5fcff
@ -33,6 +33,16 @@ buildPythonPackage rec {
|
|||||||
hash = "sha256-F8OaxLH8BL6MPNLFv1hBuVmeEdnEQ5w2Qny6by1wP6k=";
|
hash = "sha256-F8OaxLH8BL6MPNLFv1hBuVmeEdnEQ5w2Qny6by1wP6k=";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# _pickle.UnpicklingError: Weights only load failed.
|
||||||
|
# torchsnapshot needs to adapt to the change of torch.load that occured in 2.6.0:
|
||||||
|
# https://pytorch.org/docs/stable/generated/torch.load.html
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace torchsnapshot/io_preparers/object.py \
|
||||||
|
--replace-fail \
|
||||||
|
"torch.load(io.BytesIO(buf))" \
|
||||||
|
"torch.load(io.BytesIO(buf), weights_only=False)"
|
||||||
|
'';
|
||||||
|
|
||||||
build-system = [
|
build-system = [
|
||||||
setuptools
|
setuptools
|
||||||
];
|
];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user