Rapidata benchmark manager
RapidataBenchmarkManager #
A manager for benchmarks.
Used to create and retrieve benchmarks.
A benchmark is a collection of leaderboards.
Source code in src/rapidata/rapidata_client/benchmark/rapidata_benchmark_manager.py
create_new_benchmark #
create_new_benchmark(
name: str,
identifiers: Optional[list[str]] = None,
prompts: Optional[list[str | None] | list[str]] = None,
prompt_assets: Optional[
list[str | None] | list[str]
] = None,
tags: Optional[
list[list[str] | None] | list[list[str]]
] = None,
) -> RapidataBenchmark
Creates a new benchmark with the given name, identifiers, prompts, and media assets. Everything is matched up by the indexes of the lists.
prompts or identifiers must be provided, as well as prompts or prompt_assets.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the benchmark. |
required |
identifiers
|
Optional[list[str]]
|
The identifiers of the prompts/assets/tags that will be used to match up the media. If not provided, it will use the prompts as the identifiers. |
None
|
prompts
|
Optional[list[str | None] | list[str]]
|
The prompts that will be registered for the benchmark. |
None
|
prompt_assets
|
Optional[list[str | None] | list[str]]
|
The prompt assets that will be registered for the benchmark. |
None
|
tags
|
Optional[list[list[str] | None] | list[list[str]]]
|
The tags that will be associated with the prompts to use for filtering the leaderboard results. They will NOT be shown to the users. |
None
|
Example
name = "Example Benchmark"
identifiers = ["id1", "id2", "id3"]
prompts = ["prompt 1", "prompt 2", "prompt 3"]
prompt_assets = ["https://assets.rapidata.ai/prompt_1.jpg", "https://assets.rapidata.ai/prompt_2.jpg", "https://assets.rapidata.ai/prompt_3.jpg"]
tags = [["tag1", "tag2"], ["tag2"], ["tag2", "tag3"]]
benchmark = create_new_benchmark(name=name, identifiers=identifiers, prompts=prompts, prompt_assets=prompt_assets, tags=tags)
Source code in src/rapidata/rapidata_client/benchmark/rapidata_benchmark_manager.py
get_benchmark_by_id #
get_benchmark_by_id(id: str) -> RapidataBenchmark
Returns a benchmark by its ID.
Source code in src/rapidata/rapidata_client/benchmark/rapidata_benchmark_manager.py
find_benchmarks #
find_benchmarks(
name: str = "", amount: int = 10, page: int = 1
) -> list[RapidataBenchmark]
Returns a list of benchmarks by their name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the benchmark - matching benchmark will contain the name. Defaults to "" for any benchmark. |
''
|
amount
|
int
|
The amount of benchmarks to return. Defaults to 10. |
10
|
page
|
int
|
The page of benchmarks to return. Defaults to 1. |
1
|
Returns:
| Type | Description |
|---|---|
list[RapidataBenchmark]
|
list[RapidataBenchmark]: A list of RapidataBenchmark instances. |