mirror of
https://github.com/huggingface/candle.git
synced 2025-06-19 03:54:56 +00:00
Enhance pickle to retrieve state_dict with a given key (#1671)
This commit is contained in:

committed by
GitHub

parent
a90fc5ca5a
commit
b75e8945bc
@ -6,3 +6,5 @@ a= torch.tensor([[1,2,3,4], [5,6,7,8]])
|
||||
o = OrderedDict()
|
||||
o["test"] = a
|
||||
torch.save(o, "test.pt")
|
||||
|
||||
torch.save({"model_state_dict": o}, "test_with_key.pt")
|
||||
|
Reference in New Issue
Block a user