mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-09 11:20:58 +00:00
wip api
This commit is contained in:
parent
7143ecfc0d
commit
8339b2cef3
10 changed files with 174 additions and 51 deletions
19
llama_stack/providers/impls/meta_reference/evals/__init__.py
Normal file
19
llama_stack/providers/impls/meta_reference/evals/__init__.py
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
# 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 .config import MetaReferenceEvalsImplConfig # noqa
|
||||
from llama_stack.apis.inference import * # noqa: F403
|
||||
from llama_stack.distribution.datatypes import Api, ProviderSpec
|
||||
|
||||
|
||||
async def get_provider_impl(
|
||||
config: MetaReferenceEvalsImplConfig, deps: Dict[Api, ProviderSpec]
|
||||
):
|
||||
from .evals import MetaReferenceEvalsImpl
|
||||
|
||||
impl = MetaReferenceEvalsImpl(config, deps[Api.inference])
|
||||
await impl.initialize()
|
||||
return impl
|
||||
10
llama_stack/providers/impls/meta_reference/evals/config.py
Normal file
10
llama_stack/providers/impls/meta_reference/evals/config.py
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
# 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 pydantic import BaseModel
|
||||
|
||||
|
||||
class MetaReferenceEvalsImplConfig(BaseModel): ...
|
||||
34
llama_stack/providers/impls/meta_reference/evals/evals.py
Normal file
34
llama_stack/providers/impls/meta_reference/evals/evals.py
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
# 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 llama_stack.apis.inference import * # noqa: F403
|
||||
from llama_stack.apis.evals import * # noqa: F403
|
||||
|
||||
from .config import MetaReferenceEvalsImplConfig
|
||||
|
||||
|
||||
class MetaReferenceEvalsImpl(Evals):
|
||||
def __init__(self, config: MetaReferenceEvalsImplConfig, inference_api: Inference):
|
||||
self.inference_api = inference_api
|
||||
|
||||
async def initialize(self) -> None:
|
||||
pass
|
||||
|
||||
async def shutdown(self) -> None:
|
||||
pass
|
||||
|
||||
async def run_evals(
|
||||
self,
|
||||
model: str,
|
||||
dataset: str,
|
||||
task: str,
|
||||
) -> EvaluateResponse:
|
||||
print("hi")
|
||||
return EvaluateResponse(
|
||||
metrics={
|
||||
"accuracy": 0.5,
|
||||
}
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue