def METHOD_NAME(self, df: Optional[pd.DataFrame] = None, args: Optional[dict] = None):
    predict_params = args["predict_params"]
    # if user doesn't specify recommender type, default to user_item
    try:
        recommender_type = df["recommender_type"].tolist()[0]
    except KeyError:
        recommender_type = predict_params.get("recommender_type", "user_item")
    args = self.model_storage.json_get("args")
    # get item_id to idx and user_id to idx maps
    args["item_id_to_idx_map"] = dict(
        zip(args["item_idx_to_id_map"].values(), args["item_idx_to_id_map"].keys())
    )
    args["user_id_to_idx_map"] = dict(
        zip(args["user_idx_to_id_map"].values(), args["user_idx_to_id_map"].keys())
    )
    model = dill.loads(self.model_storage.file_get("model"))
    n_users = args["n_users_items"][0]
    n_items = args["n_users_items"][1]
    item_ids, user_ids = None, None
    if recommender_type == "user_item":
        if df is not None:
            if args["item_id"] in df.columns:
                n_items = df[args["item_id"]].nunique()
                item_ids = df[args["item_id"]].unique().tolist()
            if args["user_id"] in df.columns:
                n_users = df[args["user_id"]].nunique()
                user_ids = df[args["user_id"]].unique().tolist()
        return get_user_item_recommendations(
            n_users=n_users,
            n_items=n_items,
            args=args,
            model=model,
            item_ids=item_ids,
            user_ids=user_ids,
        )
    elif recommender_type == "item_item":
        if df is not None and args["item_id"] in df.columns:
            item_ids = df[args["item_id"]].unique().tolist()
        return get_item_item_recommendations(
            model=model,
            args=args,
            item_ids=item_ids,
        )
    elif recommender_type == "user_user":
        raise NotImplementedError(
            "user_user recommendation type is not implemented yet"
        )
    else:
        raise ValueError(
            "recommender_type must be either 'user_item', 'item_item' or 'user_user'"
        )