Skip to content

Commit

Permalink
feat: DIA-1573: Track predictions made with prompts (#257)
Browse files Browse the repository at this point in the history
Co-authored-by: hakan458 <[email protected]>
  • Loading branch information
hakan458 and hakan458 authored Nov 18, 2024
1 parent 3784b83 commit cc42eb3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions server/handlers/result_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,18 +208,19 @@ def __call__(self, result_batch: list[Dict]):
# coerce back to dicts for sending
result_batch = [record.dict() for record in result_batch]
if result_batch:
logger.info(f"LSEHandler sending {len(result_batch)} predictions to LSE")
num_predictions = len(result_batch)
logger.info(f"LSEHandler sending {num_predictions} predictions to LSE")
self.client.make_request(
"POST",
"/api/model-run/batch-predictions",
f"/api/model-run/batch-predictions?num_predictions={num_predictions}",
data=json.dumps(
{
"modelrun_id": self.modelrun_id,
"results": result_batch,
}
),
)
logger.info(f"LSEHandler sent {len(result_batch)} predictions to LSE")
logger.info(f"LSEHandler sent {num_predictions} predictions to LSE")
else:
logger.error(
f"No valid results to send to LSE for modelrun_id {self.modelrun_id}"
Expand Down

0 comments on commit cc42eb3

Please sign in to comment.