From 66c073000bcbb3869df745f624f6aaeb3dc0a704 Mon Sep 17 00:00:00 2001 From: sayakpaul Date: Mon, 1 Jun 2026 10:33:20 +0530 Subject: [PATCH] log quant config to the user_agent --- src/diffusers/models/modeling_utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/diffusers/models/modeling_utils.py b/src/diffusers/models/modeling_utils.py index 0423b7287193..f0b8e4a58c69 100644 --- a/src/diffusers/models/modeling_utils.py +++ b/src/diffusers/models/modeling_utils.py @@ -1100,6 +1100,7 @@ def from_pretrained(cls, pretrained_model_name_or_path: str | os.PathLike | None "diffusers": __version__, "file_type": "model", "framework": "pytorch", + "model_class": str(cls.__name__), } unused_kwargs = {} @@ -1146,8 +1147,9 @@ def from_pretrained(cls, pretrained_model_name_or_path: str | os.PathLike | None torch_dtype = hf_quantizer.update_torch_dtype(torch_dtype) device_map = hf_quantizer.update_device_map(device_map) - # In order to ensure popular quantization methods are supported. Can be disable with `disable_telemetry` + # In order to ensure popular quantization methods are supported. Can be disabled with `disable_telemetry` user_agent["quant"] = hf_quantizer.quantization_config.quant_method.value + user_agent["quant_config"] = json.dumps(quantization_config.to_dict(), sort_keys=True) # Force-set to `True` for more mem efficiency if low_cpu_mem_usage is None: