MCPcopy Create free account
hub / github.com/OpenMOSS/MOSS-TTS / load_json

Function load_json

scripts/fuse_moss_tts_delay_with_codec.py:82–93  ·  view source on GitHub ↗
(path: Path)

Source from the content-addressed store, hash-verified

80
81
82def load_json(path: Path) -> JSONDict:
83 with path.open(encoding="utf-8") as handle:
84 raw_data = cast(object, json.load(handle))
85
86 if not isinstance(raw_data, dict):
87 raise ValueError(f"Expected JSON object in {path}")
88
89 raw_keys = cast(Iterable[object], raw_data.keys())
90 if not all(isinstance(key, str) for key in raw_keys):
91 raise ValueError(f"Expected JSON object with string keys in {path}")
92
93 return cast(JSONDict, raw_data)
94
95
96def write_sorted_json(path: Path, payload: Mapping[str, object]) -> None:

Callers 6

load_source_indexFunction · 0.85
verify_fused_artifactFunction · 0.85
mainFunction · 0.85

Calls 2

loadMethod · 0.80
keysMethod · 0.80

Tested by

no test coverage detected