@classmethod
def load(cls, model: Union[(str, Path)]):
    '\n        Loads the model from the given file.\n        :param model: the model file\n        :return: the loaded text classifier model\n        '
    model_file = cls._fetch_model(str(model))
    with warnings.catch_warnings():
        warnings.filterwarnings('ignore')
        f = file_utils.load_big_file(str(model_file))
        state = torch.load(f, map_location='cpu')
    model = cls._init_model_with_state_dict(state)
    if ('model_card' in state):
        model.model_card = state['model_card']
    model.eval()
    model.to(flair.device)
    return model
Loads the model from the given file.
:param model: the model file
:return: the loaded text classifier model
@classmethod
def load(cls, model: Union[(str, Path)]):
    '\n        Loads the model from the given file.\n        :param model: the model file\n        :return: the loaded text classifier model\n        '
    model_file = cls._fetch_model(str(model))
    with warnings.catch_warnings():
        warnings.filterwarnings('ignore')
        f = file_utils.load_big_file(str(model_file))
        state = torch.load(f, map_location='cpu')
    model = cls._init_model_with_state_dict(state)
    if ('model_card' in state):
        model.model_card = state['model_card']
    model.eval()
    model.to(flair.device)
    return model