Skip to content

Commit ad25e06

Browse files
authored
Add formatting to json file with metrics (#372)
## Summary It's inconvenient to look at metrics. ## Details - ## Test Plan - code launch ## Related Issues - Resolves ##371 --- - [x] "I certify that all code in this PR is my own, except as noted below." ## Use of AI - [ ] Includes AI-assisted code completion - [ ] Includes code generated by an AI application - [ ] Includes AI-generated tests (NOTE: AI written tests should have a docstring that includes `## WRITTEN BY AI ##`)
2 parents f8f6f9d + c32896c commit ad25e06

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/guidellm/benchmark/output.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,9 @@ def save_json(self, path: Union[str, Path]) -> Path:
144144
)
145145

146146
model_dict = self.model_dump()
147-
model_json = json.dumps(model_dict)
148147

149-
with path.open("w") as file:
150-
file.write(model_json)
148+
with path.open("w", encoding="utf-8") as file:
149+
json.dump(model_dict, file, ensure_ascii=False, indent=4)
151150

152151
return path
153152

0 commit comments

Comments
 (0)