llmp.components.optimizer.examples.ExampleOptimizer¶
- class llmp.components.optimizer.examples.ExampleOptimizer(job: JobRecord, test_set: list[llmp.data_model.example_record.ExampleRecord] = None, display_progress: bool = True, max_examples_per_prompt: int = 4, debug: bool = False, **kwargs)[source]¶
Example Optimizer for a given job.
The ExampleOptimizer is used to optimize the examples for a given job.
- job¶
JobRecord
- debug¶
bool
- display_progress¶
bool
- progress_bar_config¶
dict
- MIN_EXAMPLES¶
int
- Type
int
- TEST_SIZE¶
int
- Type
int
- PROMPT_SAMPLE_SIZE¶
int
- Type
int
- SELECT_MODE¶
str
- Type
str
- INSTRUCTION_TEST_SIZE¶
int
- Type
int
- RUN_PER_SAMPLE¶
int
- Type
int
Attributes
test_set_idsMethods
__init__(job[, test_set, display_progress, ...])evaluate(job_settings, **kwargs)examples_to_prompt(examples)get_progress_bar(length, description[, sub, ...])optimize([mode, metric])Optimize the prompts and examples for a specific job.
- __init__(job: JobRecord, test_set: list[llmp.data_model.example_record.ExampleRecord] = None, display_progress: bool = True, max_examples_per_prompt: int = 4, debug: bool = False, **kwargs)[source]¶
- examples_to_prompt(examples: list[llmp.data_model.example_record.ExampleRecord])[source]¶
- get_progress_bar(length: int, description: str, sub: bool = False, desc_length: int = 40, leave: bool = True)¶