Skip to content

Commit

Permalink
[chore] Fix pre-commit on utils/metrics.py
Browse files Browse the repository at this point in the history
  • Loading branch information
kthui committed Nov 25, 2024
1 parent 2b531dd commit ccb3323
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/utils/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit ccb3323

Please sign in to comment.