mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-07-29 23:29:43 +00:00
kill reward scoring
This commit is contained in:
parent
02f4c3a081
commit
1dc2962a33
2 changed files with 0 additions and 62 deletions
|
@ -1,7 +0,0 @@
|
||||||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
||||||
# All rights reserved.
|
|
||||||
#
|
|
||||||
# This source code is licensed under the terms described in the LICENSE file in
|
|
||||||
# the root directory of this source tree.
|
|
||||||
|
|
||||||
from .reward_scoring import * # noqa: F401 F403
|
|
|
@ -1,55 +0,0 @@
|
||||||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
||||||
# All rights reserved.
|
|
||||||
#
|
|
||||||
# This source code is licensed under the terms described in the LICENSE file in
|
|
||||||
# the root directory of this source tree.
|
|
||||||
|
|
||||||
from typing import List, Protocol, Union
|
|
||||||
|
|
||||||
from llama_models.schema_utils import json_schema_type, webmethod
|
|
||||||
|
|
||||||
from pydantic import BaseModel
|
|
||||||
|
|
||||||
from llama_models.llama3.api.datatypes import * # noqa: F403
|
|
||||||
|
|
||||||
|
|
||||||
@json_schema_type
|
|
||||||
class ScoredMessage(BaseModel):
|
|
||||||
message: Message
|
|
||||||
score: float
|
|
||||||
|
|
||||||
|
|
||||||
@json_schema_type
|
|
||||||
class DialogGenerations(BaseModel):
|
|
||||||
dialog: List[Message]
|
|
||||||
sampled_generations: List[Message]
|
|
||||||
|
|
||||||
|
|
||||||
@json_schema_type
|
|
||||||
class ScoredDialogGenerations(BaseModel):
|
|
||||||
dialog: List[Message]
|
|
||||||
scored_generations: List[ScoredMessage]
|
|
||||||
|
|
||||||
|
|
||||||
@json_schema_type
|
|
||||||
class RewardScoringRequest(BaseModel):
|
|
||||||
"""Request to score a reward function. A list of prompts and a list of responses per prompt."""
|
|
||||||
|
|
||||||
dialog_generations: List[DialogGenerations]
|
|
||||||
model: str
|
|
||||||
|
|
||||||
|
|
||||||
@json_schema_type
|
|
||||||
class RewardScoringResponse(BaseModel):
|
|
||||||
"""Response from the reward scoring. Batch of (prompt, response, score) tuples that pass the threshold."""
|
|
||||||
|
|
||||||
scored_generations: List[ScoredDialogGenerations]
|
|
||||||
|
|
||||||
|
|
||||||
class RewardScoring(Protocol):
|
|
||||||
@webmethod(route="/reward_scoring/score")
|
|
||||||
def reward_score(
|
|
||||||
self,
|
|
||||||
dialog_generations: List[DialogGenerations],
|
|
||||||
model: str,
|
|
||||||
) -> Union[RewardScoringResponse]: ...
|
|
Loading…
Add table
Add a link
Reference in a new issue