Rapidata benchmark manager
RapidataBenchmarkManager #
A manager for benchmarks.
Used to create and retrieve benchmarks.
A benchmark is a collection of leaderboards.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
openapi_service
|
OpenAPIService
|
The OpenAPIService instance for API interaction. |
required |
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
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
|
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
) -> list[RapidataBenchmark]
Returns a list of benchmarks by their name.