mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-16 06:53:47 +00:00
score batch
This commit is contained in:
parent
eb572faf6f
commit
3c6555c408
4 changed files with 34 additions and 10 deletions
|
@ -209,9 +209,12 @@ class ScoringRouter(Scoring):
|
|||
pass
|
||||
|
||||
async def score_batch(
|
||||
self, dataset_id: str, scoring_functions: List[str]
|
||||
self,
|
||||
dataset_id: str,
|
||||
scoring_functions: List[str],
|
||||
save_results_dataset: bool = False,
|
||||
) -> ScoreBatchResponse:
|
||||
print("Score Batch!")
|
||||
res = {}
|
||||
for fn_identifier in scoring_functions:
|
||||
score_response = await self.routing_table.get_provider_impl(
|
||||
fn_identifier
|
||||
|
@ -219,7 +222,14 @@ class ScoringRouter(Scoring):
|
|||
dataset_id=dataset_id,
|
||||
scoring_functions=[fn_identifier],
|
||||
)
|
||||
print(score_response)
|
||||
res.update(score_response.results)
|
||||
|
||||
if save_results_dataset:
|
||||
raise NotImplementedError("Save results dataset not implemented yet")
|
||||
|
||||
return ScoreBatchResponse(
|
||||
results=res,
|
||||
)
|
||||
|
||||
async def score(
|
||||
self, input_rows: List[Dict[str, Any]], scoring_functions: List[str]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue