Skip to content

Commit e996f3a

Browse files
committed
convert : fix no-lazy dtypes from direct safetensors
1 parent e7b7ed8 commit e996f3a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

convert_hf_to_gguf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ def index_tensors(self, remote_hf_model_id: str | None = None) -> dict[str, Call
232232
data_gen = lambda data=data: LazyTorchTensor.from_local_tensor(data) # noqa: E731
233233
else:
234234
dtype = LazyTorchTensor._dtype_str_map[data.dtype]
235-
data_gen = lambda data=data: torch.from_numpy(data.mmap_bytes()).view(dtype).reshape(data.shape) # noqa: E731
235+
data_gen = lambda data=data, dtype=dtype: torch.from_numpy(data.mmap_bytes()).view(dtype).reshape(data.shape) # noqa: E731
236236
else:
237237
data_torch: Tensor = model_part[name]
238238
if self.lazy:

0 commit comments

Comments
 (0)