浏览代码

Fix conversion script

Sengxian 2 年之前
父节点
当前提交
f9276c6988
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      tools/convert_tp.py

+ 1 - 1
tools/convert_tp.py

@@ -117,7 +117,7 @@ def create_checkpoint(
                 is_glu=name in GLU_LAYERS,
                 quantization_bit_width=quantization_bit_width if name in QUANTIZED_LAYERS else None,
             )
-            if name in QUANTIZED_LAYERS:
+            if quantization_bit_width is not None and name in QUANTIZED_LAYERS:
                 new_sd[key], new_sd[f"{key}_scale"] = new_sd[key]
     new_sd = {"module": new_sd}
     return new_sd