convert : fix no-lazy dtypes from direct safetensors
This commit is contained in:
parent
e7b7ed8ab1
commit
e996f3aef8
|
|
@ -232,7 +232,7 @@ class ModelBase:
|
|||
data_gen = lambda data=data: LazyTorchTensor.from_local_tensor(data) # noqa: E731
|
||||
else:
|
||||
dtype = LazyTorchTensor._dtype_str_map[data.dtype]
|
||||
data_gen = lambda data=data: torch.from_numpy(data.mmap_bytes()).view(dtype).reshape(data.shape) # noqa: E731
|
||||
data_gen = lambda data=data, dtype=dtype: torch.from_numpy(data.mmap_bytes()).view(dtype).reshape(data.shape) # noqa: E731
|
||||
else:
|
||||
data_torch: Tensor = model_part[name]
|
||||
if self.lazy:
|
||||
|
|
|
|||
Loading…
Reference in New Issue