import torch


def load_model_from_file(path, model):
    """
    Load a (trained) model from file.

    Parameters
    ----------
    path: str
        File where the model to be loaded is saved.

    Returns
    -------
    Pytorch object
        Pytorch object as defined in the file.
    """
    model.load_state_dict(torch.load(path))
    model.eval()
    return model