From: Jie Fu (傅杰) Date: Mon, 1 Sep 2025 15:53:31 +0000 (+0800) Subject: convert : remove redundant code (#15708) X-Git-Tag: upstream/0.0.6527~182 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=4b20d8b7e31718d3fe8b4f12d220a9d19e4f1997;p=pkg%2Fggml%2Fsources%2Fllama.cpp convert : remove redundant code (#15708) Signed-off-by: Jie Fu --- diff --git a/convert_hf_to_gguf.py b/convert_hf_to_gguf.py index df37c4a6..908435d7 100755 --- a/convert_hf_to_gguf.py +++ b/convert_hf_to_gguf.py @@ -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)