modelzoo.common.pytorch.run_cstorch_eval_harness.CSEvalHarnessAdapter#
- class modelzoo.common.pytorch.run_cstorch_eval_harness.CSEvalHarnessAdapter[source]#
Bases:
lm_eval.base.LM
Initializes cstorch components required for executing eval harness on appliance, overriding the loglikelihood method that performs this execution. Subclasses the base LM class that is accepted by the main evaluator.evaluate method of the EEH script.
Methods
Sets up CS cluster config for the run.
greedy_until
Initializes the model for the cstorch API.
This is the overriden method of the LM base class in EEH script.
loglikelihood_rolling
- __call__(*args: Any, **kwargs: Any) Any #
Call self as a function.
- static __new__(cls, *args: Any, **kwargs: Any) Any #
- loglikelihood(requests) List[Tuple[float, bool]] [source]#
This is the overriden method of the LM base class in EEH script. This method preprocesses the raw text requests, generates the data samples to be consumed by the GPT2 model, and executes the data on the appliance.
- Parameters
requests – list of raw text context, continuation pair of tuples
- Returns
list of size len(requests) comprising post-processed results tuple as expected by the EEH script