fix routing table

This commit is contained in:
Xi Yan 2025-03-18 20:43:27 -07:00
parent 9a660a934b
commit 919955a2bf

View file

@ -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