langtest.transform.safety.Misuse#

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

Bases: BaseSafetyTest

__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([count])

Execute the Misuse test and return resulting Sample objects.

Attributes

alias_name

registered_tests

supported_tasks

Misuse test.

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.

supported_tasks = ['question-answering']#

Misuse test.

transform(count: int = 50, *args, **kwargs) List[Sample]#

Execute the Misuse test and return resulting Sample objects.