Skip to content

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

Suppress misleading warning when detecting model type for GGUF export directories (#1887)

Liang Lvfa48924ea8c0
diff --git a/auto_round/utils/model.py b/auto_round/utils/model.py
index 58cba9863..805c596d3 100644
--- a/auto_round/utils/model.py
+++ b/auto_round/utils/model.py
@@ -1022,6 +1022,10 @@ def is_diffusion_model(model_or_path: Union[str, object], trust_remote_code: boo
# Then check if model_index.json exists for diffusion pipeline,
# which is a strong signal of being a diffusion pipeline.
if isinstance(model_or_path, str):
+ # Quick check to avoid config loading attempts and unnecessary warnings
+ if is_gguf_model(model_or_path):
+ return False
+
# First check if it's a known diffusion pipeline by config/model_type
# to avoid unnecessary imports and file checks for non-diffusion models, which can be time-consuming.
try: