Skip to content

Commit

Permalink
Merge branch 'add_llm_guided_metrics' of github.com:Striveworks/valor…
Browse files Browse the repository at this point in the history
… into add_llm_guided_metrics
  • Loading branch information
b.nativi committed Jun 26, 2024
2 parents 7c32c64 + a17d78d commit 2b87c9d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions api/valor_api/logging.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import time
from typing import Awaitable, Callable, Union

import structlog
Expand All @@ -15,13 +16,16 @@ async def log_endpoint_middleware(
request: Request,
call_next: Callable[[Request], Awaitable[Union[Response, JSONResponse]]],
) -> Union[Response, JSONResponse]:
start_time = time.monotonic()
response = await call_next(request)
duration_seconds = time.monotonic() - start_time
logger.info(
"Valor API Call",
method=request.method,
path=request.url.path,
hostname=request.url.hostname,
status=response.status_code,
duration_ms=duration_seconds * 1000,
)
return response

Expand Down
2 changes: 1 addition & 1 deletion docs/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ print(detailed_evaluation)

[...,
{
"type": "PrecisionRecallCurve",
"type": "DetailedPrecisionRecallCurve",
"parameters": {
"label_key": "class", # The key of the label.
"pr_curve_iou_threshold": 0.5,
Expand Down

0 comments on commit 2b87c9d

Please sign in to comment.