langtest.transform.performance.BasePerformance#
- class BasePerformance#
Bases:
ABC
Abstract base class for implementing a model performance.
This class defines the interface for implementing a model performance.
- None#
- __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)Abstract method that transforms the sample data based on the implemented model performance.
Attributes
TOKENS
alias_name
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]
- abstract static transform()#
Abstract method that transforms the sample data based on the implemented model performance.
- Parameters:
params (dict) – The input data to be transformed.
*args – Additional positional arguments.
**kwargs – Additional keyword arguments.
- Returns:
The transformed data based on the implemented model performance.
- Return type:
List[Sample]
- Raises:
NotImplementedError – This method must be implemented in the derived class.