MCPcopy Create free account
hub / github.com/TabbyML/tabby / save_as_json

Method save_as_json

python/ctranslate2/specs/model_spec.py:311–320  ·  view source on GitHub ↗

Saves the configuration as a JSON file.

(self, path)

Source from the content-addressed store, hash-verified

309 self.__dict__[key] = value
310
311 def save_as_json(self, path):
312 """Saves the configuration as a JSON file."""
313 with open(path, "w", encoding="utf-8") as config_file:
314 json.dump(
315 self.to_dict(),
316 config_file,
317 indent=2,
318 sort_keys=True,
319 )
320 config_file.write("\n")
321
322
323class ModelSpec(LayerSpec):

Callers 1

saveMethod · 0.80

Calls 2

to_dictMethod · 0.95
dumpMethod · 0.45

Tested by

no test coverage detected