def METHOD_NAME(self, sample, model, criterion):
    model.eval()
    # task ids
    if self.task_type == "lang":
        encoder_task_ids = sample["src_lang_ids"]
        decoder_task_ids = sample["tgt_lang_ids"]
    elif self.task_type == "domain":
        encoder_task_ids = sample["domain_ids"]
        decoder_task_ids = sample["domain_ids"]
    model.encoder.set_task_ids(encoder_task_ids)
    model.decoder.set_task_ids(decoder_task_ids)
    with torch.no_grad():
        loss, sample_size, logging_output = criterion(model, sample)
    return loss, sample_size, logging_output