scorer registry

This commit is contained in:
Xi Yan 2024-10-14 15:41:31 -07:00
parent 9c501d042b
commit c50686b6fe
5 changed files with 55 additions and 32 deletions

View file

@ -5,9 +5,19 @@
# the root directory of this source tree.
# TODO: make these import config based
from llama_stack.apis.evals import * # noqa: F403
from llama_stack.providers.impls.meta_reference.evals.scorer.basic_scorers import * # noqa: F403
from ..registry import Registry
class ScorerRegistry(Registry[BaseScorer]):
_REGISTRY: Dict[str, BaseScorer] = {}
SCORER_REGISTRY = {
"accuracy": AccuracyScorer,
"random": RandomScorer,
}
for k, v in SCORER_REGISTRY.items():
ScorerRegistry.register(k, v)