langtest.transform.performance.Speed#

class Speed#

Bases: BasePerformance

Speed measure class.

This class implements the speed measure. The speed measure is the time it takes for the model to run on the test case.

__init__()#

Methods

__init__()

async_run(sample_list, model, **kwargs)

Creates a task to run the model performance.

run(sample_list, model, **kwargs)

Abstract method that implements the model performance.

time_measure(start_time, sample_list, tokens)

transform(params, *args, **kwargs)

Transforms the sample data based on the implemented tests measure.

Attributes

TOKENS

alias_name

supported_tasks

test_types

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

Creates a task to run the model performance.

Parameters:
  • sample_list (List[Sample]) – The input data to be transformed.

  • model (ModelAPI) – The model to be used for evaluation.

  • **kwargs – Additional arguments to be passed to the model performance.

Returns:

The task that runs the model performance.

Return type:

asyncio.Task

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

Abstract method that implements the model performance.

Parameters:
  • sample_list (List[Sample]) – The input data to be transformed.

  • model (ModelAPI) – The model to be used for evaluation.

  • **kwargs – Additional arguments to be passed to the model performance.

Returns:

The transformed data based on the implemented model performance.

Return type:

List[Sample]

static transform(params: dict, *args, **kwargs) List[Sample]#

Transforms the sample data based on the implemented tests measure.

Parameters:
  • sample (Sample) – The input data to be transformed.

  • **kwargs – Additional arguments to be passed to the tests measure.

Returns:

The transformed data based on the implemented tests measure.

Return type:

Sample