mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-07 02:58:21 +00:00
fix routing table
This commit is contained in:
parent
9a660a934b
commit
919955a2bf
1 changed files with 7 additions and 10 deletions
|
@ -481,15 +481,12 @@ class BenchmarksRoutingTable(CommonRoutingTableImpl, Benchmarks):
|
||||||
) -> Benchmark:
|
) -> Benchmark:
|
||||||
if metadata is None:
|
if metadata is None:
|
||||||
metadata = {}
|
metadata = {}
|
||||||
if provider_id is None:
|
|
||||||
if len(self.impls_by_provider_id) == 1:
|
# TODO (xiyan): we will need a way to infer provider_id for evaluation
|
||||||
provider_id = list(self.impls_by_provider_id.keys())[0]
|
# keep it as meta-reference for now
|
||||||
else:
|
if len(self.impls_by_provider_id) == 0:
|
||||||
raise ValueError(
|
raise ValueError("No evaluation providers available. Please configure an evaluation provider.")
|
||||||
"No provider specified and multiple providers available. Please specify a provider_id."
|
provider_id = list(self.impls_by_provider_id.keys())[0]
|
||||||
)
|
|
||||||
if provider_benchmark_id is None:
|
|
||||||
provider_benchmark_id = benchmark_id
|
|
||||||
|
|
||||||
benchmark = Benchmark(
|
benchmark = Benchmark(
|
||||||
identifier=benchmark_id,
|
identifier=benchmark_id,
|
||||||
|
@ -497,7 +494,7 @@ class BenchmarksRoutingTable(CommonRoutingTableImpl, Benchmarks):
|
||||||
grader_ids=grader_ids,
|
grader_ids=grader_ids,
|
||||||
metadata=metadata,
|
metadata=metadata,
|
||||||
provider_id=provider_id,
|
provider_id=provider_id,
|
||||||
provider_resource_id=provider_benchmark_id,
|
provider_resource_id=benchmark_id,
|
||||||
)
|
)
|
||||||
await self.register_object(benchmark)
|
await self.register_object(benchmark)
|
||||||
return benchmark
|
return benchmark
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue