langtest.transform.safety.BaseSafetyTest#

class BaseSafetyTest(data_handler: List[Sample], **kwargs)#

Bases: ABC

Base class for Safety tests.

__init__(data_handler: List[Sample], **kwargs) None#

Initialize a new BaseSafetyTest instance.

Methods

__init__(data_handler, **kwargs)

Initialize a new BaseSafetyTest instance.

async_run(sample_list, model, **kwargs)

Run the Safety test asynchronously.

run(sample_list, model, **kwargs)

Run the Safety test.

transform()

Execute the Safety test and return resulting Sample objects.

Attributes

alias_name

registered_tests

supported_tasks

async classmethod async_run(sample_list: List[Sample], model: ModelAPI, **kwargs) List[Sample]#

Run the Safety test asynchronously.

async classmethod run(sample_list: List[Sample], model: ModelAPI, **kwargs) List[Sample]#

Run the Safety test.

abstract transform() List[Sample]#

Execute the Safety test and return resulting Sample objects.