MCPcopy Create free account
hub / github.com/huggingface/diffusers / to_json_file

Method to_json_file

src/diffusers/configuration_utils.py:664–673  ·  view source on GitHub ↗

Save the configuration instance's parameters to a JSON file. Args: json_file_path (`str` or `os.PathLike`): Path to the JSON file to save a configuration instance's parameters.

(self, json_file_path: str | os.PathLike)

Source from the content-addressed store, hash-verified

662 return json.dumps(config_dict, indent=2, sort_keys=True) + "\n"
663
664 def to_json_file(self, json_file_path: str | os.PathLike):
665 """
666 Save the configuration instance's parameters to a JSON file.
667
668 Args:
669 json_file_path (`str` or `os.PathLike`):
670 Path to the JSON file to save a configuration instance's parameters.
671 """
672 with open(json_file_path, "w", encoding="utf-8") as writer:
673 writer.write(self.to_json_string())
674
675 @classmethod
676 def _get_config_file_from_dduf(cls, pretrained_model_name_or_path: str, dduf_entries: dict[str, DDUFEntry]):

Callers 1

save_configMethod · 0.95

Calls 1

to_json_stringMethod · 0.95

Tested by

no test coverage detected