from typing import Any
import dill
import codecs


def torch_decoder(model_ser: str) -> Any:
    """
    Decodes the torch object or model
    :param model_ser: Serialized object
    :return: the object
    """
    return dill.loads(codecs.decode(model_ser.encode(), "base64"))