mirror of
https://github.com/huggingface/candle.git
synced 2025-06-18 11:37:11 +00:00
Fix: pth files don't load on Windows (#1661)
* Don't treat zip path as OS path * Add a test case * Add code to generate test pth data
This commit is contained in:
8
candle-core/tests/pth.py
Normal file
8
candle-core/tests/pth.py
Normal file
@ -0,0 +1,8 @@
|
||||
import torch
|
||||
from collections import OrderedDict
|
||||
|
||||
# Write a trivial tensor to a pt file
|
||||
a= torch.tensor([[1,2,3,4], [5,6,7,8]])
|
||||
o = OrderedDict()
|
||||
o["test"] = a
|
||||
torch.save(o, "test.pt")
|
Reference in New Issue
Block a user