From ccb3323d8fc25db300f7b606f6ca1cdf2955b06d Mon Sep 17 00:00:00 2001 From: kthui <18255193+kthui@users.noreply.github.com> Date: Mon, 25 Nov 2024 15:47:46 -0800 Subject: [PATCH] [chore] Fix pre-commit on utils/metrics.py --- src/utils/metrics.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/utils/metrics.py b/src/utils/metrics.py index 0504eef9..48b77a2c 100644 --- a/src/utils/metrics.py +++ b/src/utils/metrics.py @@ -34,6 +34,7 @@ from vllm.engine.metrics import SupportsMetricsInfo, build_1_2_5_buckets from vllm.version import __version__ as _VLLM_VERSION + class TritonMetrics: def __init__(self, labels: List[str], max_model_len: int): # Initialize metric families @@ -163,9 +164,11 @@ def __init__(self, labels: List[str], max_model_len: int): ) ) if _VLLM_VERSION < "0.6.3": - self.histogram_best_of_request = self.histogram_best_of_request_family.Metric( - labels=labels, - buckets=[1, 2, 5, 10, 20], + self.histogram_best_of_request = ( + self.histogram_best_of_request_family.Metric( + labels=labels, + buckets=[1, 2, 5, 10, 20], + ) ) self.histogram_n_request = self.histogram_n_request_family.Metric( labels=labels, @@ -254,7 +257,9 @@ def log(self, stats: VllmStats) -> None: (self.metrics.histogram_n_request, stats.n_requests), ] if _VLLM_VERSION < "0.6.3": - histogram_metrics.append((self.metrics.histogram_best_of_request, stats.best_of_requests)) + histogram_metrics.append( + (self.metrics.histogram_best_of_request, stats.best_of_requests) + ) for metric, data in counter_metrics: self._log_counter(metric, data) for metric, data in histogram_metrics: