Skip to content

Commit e582f1a

Browse files
committed
convert : fix no-lazy dtypes from direct safetensors
1 parent 0edc189 commit e582f1a

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
@@ -209,7 +209,7 @@ def index_tensors(self, remote_hf_model_id: str | None = None) -> dict[str, Call
209209
data_gen = lambda data=data: LazyTorchTensor.from_local_tensor(data) # noqa: E731
210210
else:
211211
dtype = LazyTorchTensor._dtype_str_map[data.dtype]
212-
data_gen = lambda data=data: torch.from_numpy(data.mmap_bytes()).view(dtype).reshape(data.shape) # noqa: E731
212+
data_gen = lambda data=data, dtype=dtype: torch.from_numpy(data.mmap_bytes()).view(dtype).reshape(data.shape) # noqa: E731
213213
else:
214214
data_torch: Tensor = model_part[name]
215215
if self.lazy:

0 commit comments

Comments
 (0)