mirror of
https://github.com/huggingface/candle.git
synced 2025-06-19 19:58:35 +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:
@ -227,13 +227,11 @@ impl Object {
|
||||
_ => return Ok(None),
|
||||
};
|
||||
let (layout, dtype, file_path, storage_size) = rebuild_args(args)?;
|
||||
let mut path = dir_name.to_path_buf();
|
||||
path.push(file_path);
|
||||
Ok(Some(TensorInfo {
|
||||
name,
|
||||
dtype,
|
||||
layout,
|
||||
path: path.to_string_lossy().into_owned(),
|
||||
path: format!("{}/{}", dir_name.to_string_lossy(), file_path),
|
||||
storage_size,
|
||||
}))
|
||||
}
|
||||
|
Reference in New Issue
Block a user