|
2 | 2 | import json |
3 | 3 | import math |
4 | 4 | from collections import OrderedDict |
| 5 | +from copy import deepcopy |
5 | 6 | from datetime import datetime |
6 | 7 | from pathlib import Path |
7 | 8 | from typing import Any, Literal, Optional, Union |
8 | 9 |
|
9 | | -import humps # type: ignore[import-not-found] |
10 | 10 | import yaml |
11 | 11 | from pydantic import Field |
12 | 12 | from rich.console import Console |
|
30 | 30 | from guidellm.presentation.injector import create_report |
31 | 31 | from guidellm.scheduler import strategy_display_str |
32 | 32 | from guidellm.utils import Colors, split_text_list_by_length |
| 33 | +from guidellm.utils.dict import recursive_key_update |
| 34 | +from guidellm.utils.text import camelize_str |
33 | 35 |
|
34 | 36 | __all__ = [ |
35 | 37 | "GenerativeBenchmarksConsole", |
@@ -239,11 +241,11 @@ def save_html(self, path: Union[str, Path]) -> Path: |
239 | 241 |
|
240 | 242 | data_builder = UIDataBuilder(self.benchmarks) |
241 | 243 | data = data_builder.to_dict() |
242 | | - camel_data = humps.camelize(data) |
| 244 | + camel_data = recursive_key_update(deepcopy(data), camelize_str) |
243 | 245 | ui_api_data = {} |
244 | 246 | for k, v in camel_data.items(): |
245 | | - key = f"window.{humps.decamelize(k)} = {{}};" |
246 | | - value = f"window.{humps.decamelize(k)} = {json.dumps(v, indent=2)};\n" |
| 247 | + key = f"window.{k} = {{}};" |
| 248 | + value = f"window.{k} = {json.dumps(v, indent=2)};\n" |
247 | 249 | ui_api_data[key] = value |
248 | 250 | return create_report(ui_api_data, path) |
249 | 251 |
|
|
0 commit comments