mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-10 04:08:31 +00:00
scoring job
This commit is contained in:
parent
5f330c3971
commit
f88755eb93
1 changed files with 21 additions and 4 deletions
|
@ -68,15 +68,15 @@ class ScoringFunctionStore(Protocol):
|
||||||
class Scoring(Protocol):
|
class Scoring(Protocol):
|
||||||
scoring_function_store: ScoringFunctionStore
|
scoring_function_store: ScoringFunctionStore
|
||||||
|
|
||||||
@webmethod(route="/scoring/score-batch", method="POST")
|
@webmethod(route="/scoring/jobs", method="POST")
|
||||||
async def score_batch(
|
async def score_dataset(
|
||||||
self,
|
self,
|
||||||
dataset_id: str,
|
dataset_id: str,
|
||||||
scoring_functions: List[ScoringFnParams],
|
scoring_functions: List[ScoringFnParams],
|
||||||
) -> ScoringJob: ...
|
) -> ScoringJob: ...
|
||||||
|
|
||||||
@webmethod(route="/scoring/score", method="POST")
|
@webmethod(route="/scoring/rows", method="POST")
|
||||||
async def score(
|
async def score_rows(
|
||||||
self,
|
self,
|
||||||
input_rows: List[Dict[str, Any]],
|
input_rows: List[Dict[str, Any]],
|
||||||
scoring_functions: List[ScoringFnParams],
|
scoring_functions: List[ScoringFnParams],
|
||||||
|
@ -88,3 +88,20 @@ class Scoring(Protocol):
|
||||||
:return: ScoreResponse object containing rows and aggregated results
|
:return: ScoreResponse object containing rows and aggregated results
|
||||||
"""
|
"""
|
||||||
...
|
...
|
||||||
|
|
||||||
|
@webmethod(route="/scoring/jobs/{job_id}", method="GET")
|
||||||
|
async def get_job(self, job_id: str) -> Optional[ScoringJob]:
|
||||||
|
"""Get the ScoringJob object for a given job id.
|
||||||
|
|
||||||
|
:param job_id: The ID of the job to get the status of.
|
||||||
|
:return: ScoringJob object indicating its status
|
||||||
|
"""
|
||||||
|
...
|
||||||
|
|
||||||
|
@webmethod(route="/scoring/jobs/{job_id}", method="DELETE")
|
||||||
|
async def cancel_job(self, job_id: str) -> None:
|
||||||
|
"""Cancel a job.
|
||||||
|
|
||||||
|
:param job_id: The ID of the job to cancel.
|
||||||
|
"""
|
||||||
|
...
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue