]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
convert : remove redundant code (#15708)
authorJie Fu (傅杰) <redacted>
Mon, 1 Sep 2025 15:53:31 +0000 (23:53 +0800)
committerGitHub <redacted>
Mon, 1 Sep 2025 15:53:31 +0000 (23:53 +0800)
Signed-off-by: Jie Fu <redacted>
convert_hf_to_gguf.py

index df37c4a6e430c10588c89980032f67eb7b0fa860..908435d7e5f00ce1d370e7c368e7dd47a0172b7a 100755 (executable)
@@ -302,10 +302,6 @@ class ModelBase:
                 # data = data_torch.squeeze().numpy()
                 data = data_torch.numpy()
 
-                # if data ends up empty, it means data_torch was a scalar tensor -> restore
-                if len(data.shape) == 0:
-                    data = data_torch.numpy()
-
                 n_dims = len(data.shape)
                 data_qtype: gguf.GGMLQuantizationType | bool = self.tensor_force_quant(name, new_name, bid, n_dims)