import torch


def predict(images, model, decoder, device):
    """Make model prediction.

    Args:
        images (torch.Tensor): Batch with tensor images.
        model (ocr.src.models.CRNN): OCR model.
        decoder: BeamSearcDecoder or BestPathDecoder class from ocr.tokenizer.
        device (torch.device): Torch device.
    """
    model.eval()
    images = images.to(device)
    with torch.no_grad():
        output = model(images)
    text_preds = decoder(output)
    return text_preds