MCPcopy Index your code
hub / github.com/huggingface/diffusers / to_json_saveable

Method to_json_saveable

src/diffusers/configuration_utils.py:631–640  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

629 config_dict["_diffusers_version"] = __version__
630
631 def to_json_saveable(value):
632 if isinstance(value, np.ndarray):
633 value = value.tolist()
634 elif isinstance(value, Path):
635 value = value.as_posix()
636 elif hasattr(value, "to_dict") and callable(value.to_dict):
637 value = value.to_dict()
638 elif isinstance(value, list):
639 value = [to_json_saveable(v) for v in value]
640 return value
641
642 if "quantization_config" in config_dict:
643 config_dict["quantization_config"] = (

Callers

nothing calls this directly

Calls 1

to_dictMethod · 0.45

Tested by

no test coverage detected