def METHOD_NAME(self, inputs):
    if isinstance(inputs, dict):
        inputs = [inputs]
    if isinstance(inputs, list):
        input_list = []
        for example in inputs:
            data = {}
            if isinstance(example, dict):
                if "doc" not in example.keys():
                    raise ValueError(
                        "Invalid inputs, the inputs should contain an url to an image or a local path."
                    )
                else:
                    if isinstance(example["doc"], str):
                        if example["doc"].startswith("http://") or example["doc"].startswith("https://"):
                            download_file("./", example["doc"].rsplit("/", 1)[-1], example["doc"])
                            data["doc"] = example["doc"].rsplit("/", 1)[-1]
                        elif os.path.isfile(example["doc"]):
                            data["doc"] = example["doc"]
                        else:
                            img = base64.b64decode(example["doc"].encode("utf-8"))
                            img = np.frombuffer(bytearray(img), dtype="uint8")
                            img = np.array(Image.open(BytesIO(img)).convert("RGB"))
                            img = Image.fromarray(img)
                            img.save("./tmp.jpg")
                            data["doc"] = "./tmp.jpg"
                    else:
                        raise ValueError("Incorrect path or url, URLs must start with `http://` or `https://`")
                if "prompt" not in example.keys():
                    raise ValueError("Invalid inputs, the inputs should contain the prompt.")
                else:
                    if isinstance(example["prompt"], str):
                        data["prompt"] = [example["prompt"]]
                    elif isinstance(example["prompt"], list) and all(
                        isinstance(s, str) for s in example["prompt"]
                    ):
                        data["prompt"] = example["prompt"]
                    else:
                        raise TypeError("Incorrect prompt, prompt should be string or list of string.")
                if "word_boxes" in example.keys():
                    data["word_boxes"] = example["word_boxes"]
                input_list.append(data)
            else:
                raise TypeError(
                    "Invalid inputs, input for document intelligence task should be dict or list of dict, but type of {} found!".format(
                        type(example)
                    )
                )
    else:
        raise TypeError(
            "Invalid inputs, input for document intelligence task should be dict or list of dict, but type of {} found!".format(
                type(inputs)
            )
        )
    return input_list