Skip to content

Commit 89512d2

Browse files
authored
[chore] log quant config to the user_agent (#13850)
log quant config to the user_agent
1 parent f809080 commit 89512d2

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/diffusers/models/modeling_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1100,6 +1100,7 @@ def from_pretrained(cls, pretrained_model_name_or_path: str | os.PathLike | None
11001100
"diffusers": __version__,
11011101
"file_type": "model",
11021102
"framework": "pytorch",
1103+
"model_class": str(cls.__name__),
11031104
}
11041105
unused_kwargs = {}
11051106

@@ -1146,8 +1147,9 @@ def from_pretrained(cls, pretrained_model_name_or_path: str | os.PathLike | None
11461147
torch_dtype = hf_quantizer.update_torch_dtype(torch_dtype)
11471148
device_map = hf_quantizer.update_device_map(device_map)
11481149

1149-
# In order to ensure popular quantization methods are supported. Can be disable with `disable_telemetry`
1150+
# In order to ensure popular quantization methods are supported. Can be disabled with `disable_telemetry`
11501151
user_agent["quant"] = hf_quantizer.quantization_config.quant_method.value
1152+
user_agent["quant_config"] = json.dumps(quantization_config.to_dict(), sort_keys=True)
11511153

11521154
# Force-set to `True` for more mem efficiency
11531155
if low_cpu_mem_usage is None:

0 commit comments

Comments
 (0)