Skip to content

PTQ-Level Efficiency, QAT-Level Accuracy | 训练后量化的效率,量化感知训练的精度

Refine model save folder name (#1549)

Tang Kaihui68d5568be221
diff --git a/auto_round/__main__.py b/auto_round/__main__.py
index 5721a9501..9b98b857e 100644
--- a/auto_round/__main__.py
+++ b/auto_round/__main__.py
@@ -740,7 +740,11 @@ def tune(args):
suffix = f"a{autoround.act_bits}"
else:
suffix = f"g{autoround.group_size}"
- export_dir = os.path.join(args.output_dir, model_name.split("/")[-1] + f"-w{autoround.bits}{suffix}")
+ prefix = autoround.data_type.lower().replace("_", "") if "int" not in autoround.data_type else ""
+ export_dir = os.path.join(
+ args.output_dir,
+ model_name.split("/")[-1] + (f"-{prefix}" if prefix else "") + f"-w{autoround.bits}{suffix}",
+ )
# ======================= Quantize and save model =======================
model, folders = autoround.quantize_and_save(export_dir, format=args.format) # pylint: disable=E1101