import torch
from typing import Tuple


def get_prediction(
        image: torch.Tensor,
        model: torch.nn.Module
) -> Tuple[float, int]:
    """Predicts the most likely category with its associated probability.

    Parameters
    ----------
    image : torch.Tensor
        Image in a form of tensor ready to enter into the model.
    model : torch.nn.Module
        Model for inference.

    Returns
    -------
    Tuple[float, int]
        Predicted category with its probability.
    """
    output = model(image)
    log_softmax, prediction = output.max(1)
    probability = torch.exp(log_softmax).item()
    prediction = prediction.item()

    return probability, prediction