From d23bdd57b04824b14e5e52b70af738c544c8c3cd Mon Sep 17 00:00:00 2001 From: Francis Couture-Harpin Date: Thu, 6 Nov 2025 21:11:52 -0500 Subject: [PATCH] convert : handle int-quantized models --- convert_hf_to_gguf.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/convert_hf_to_gguf.py b/convert_hf_to_gguf.py index 9a3e56a9c8..14ccb24942 100755 --- a/convert_hf_to_gguf.py +++ b/convert_hf_to_gguf.py @@ -411,9 +411,11 @@ class ModelBase: if len(groups) > 1: raise NotImplementedError("Can't handle multiple config groups for compressed-tensors yet") weight_config = tuple(groups.values())[0]["weights"] - if quant_format == "float-quantized": + + if quant_format == "float-quantized" or quant_format == "int-quantized": block_size = weight_config.get("block_structure", None) - assert weight_config.get("strategy") == "channel" + strategy = weight_config.get("strategy") + assert strategy == "channel" or strategy == "block" assert weight_config.get("group_size") == None # didn't find a model using this yet for name in self.model_tensors.keys(): if name.endswith(".weight_scale"): @@ -444,6 +446,8 @@ class ModelBase: tensors_to_remove += [base_name + n for n in ("_packed", "_shape", "_scale")] if (base_name + "_zero_point") in self.model_tensors: tensors_to_remove.append(base_name + "_zero_point") + else: + raise NotImplementedError(f"Quant format {quant_format!r} for method {quant_method!r} is not yet supported") else: raise NotImplementedError(f"Quant method is not yet supported: {quant_method!r}")