mbrs.metrics.cometkiwi module#
- class mbrs.metrics.cometkiwi.MetricCOMETkiwi(cfg: Config)[source]#
Bases:
MetricReferencelessCOMETkiwi metric class.
- class Config(model: str = 'Unbabel/wmt22-cometkiwi-da', batch_size: int = 64, fp16: bool = False, bf16: bool = False, cpu: bool = False)[source]#
Bases:
ConfigCOMETkiwi metric configuration.
model (str): Model name or path.
batch_size (int): Batch size.
fp16 (bool): Use float16 for the forward computation.
bf16 (bool): Use bfloat16 for the forward computation.
cpu (bool): Use CPU for the forward computation.
- corpus_score(hypotheses: list[str], sources: list[str]) float[source]#
Calculate the corpus-level score.
- property device: device#
Returns the device of the model.