MCPcopy Create free account
hub / github.com/SandAI-org/MAGI-1 / SimpleJSONEncoder

Class SimpleJSONEncoder

inference/common/config.py:165–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163
164 def to_json(self, json_path: str):
165 class SimpleJSONEncoder(json.JSONEncoder):
166 def default(self, obj):
167 if isinstance(obj, torch.dtype):
168 return str(obj)
169 return super().default(obj)
170
171 # Ensure the directory exists
172 os.makedirs(os.path.dirname(json_path), exist_ok=True)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected