{"record":{"id":"72410ce7ca7ac293","repo":"huggingface/transformers","slug":"only-a-single-or-a-list-of-entries-is-supported-bu-72410c","errorCode":null,"errorMessage":"only a single or a list of entries is supported but got type={type(image_url_or_urls)}","messagePattern":"only a single or a list of entries is supported but got type=(.+?)","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"src/transformers/image_processing_backends.py","lineNumber":114,"sourceCode":"        `str`: The backend used by this image processor.\n        \"\"\"\n        return \"torchvision\"\n\n    def fetch_images(self, image_url_or_urls: str | list[str] | list[list[str]]):\n        \"\"\"\n        Convert a single or a list of URLs / paths into `torch.Tensor` objects.\n\n        Already-valid image objects (tensors, numpy arrays, PIL Images) are passed through\n        unchanged so that callers who pre-load images are unaffected.\n        \"\"\"\n        if isinstance(image_url_or_urls, (list, tuple)):\n            return [self.fetch_images(x) for x in image_url_or_urls]\n        elif isinstance(image_url_or_urls, str):\n            return load_image_as_tensor(image_url_or_urls)\n        elif is_valid_image(image_url_or_urls):\n            return image_url_or_urls\n        else:\n            raise TypeError(f\"only a single or a list of entries is supported but got type={type(image_url_or_urls)}\")\n\n    def process_image(\n        self,\n        image: ImageInput,\n        do_convert_rgb: bool | None = None,\n        input_data_format: str | ChannelDimension | None = None,\n        device: Optional[\"torch.device\"] = None,\n        **kwargs: Unpack[ImagesKwargs],\n    ) -> \"torch.Tensor\":\n        \"\"\"Process a single image for torchvision backend.\"\"\"\n        image_type = get_image_type(image)\n        if image_type not in [ImageType.PIL, ImageType.TORCH, ImageType.NUMPY]:\n            raise ValueError(f\"Unsupported input image type {image_type}\")\n\n        if do_convert_rgb:\n            image = self.convert_to_rgb(image)\n\n        if image_type == ImageType.PIL:","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/huggingface/transformers/blob/a597f974857b3d92939971296bc0deb93d33d780/src/transformers/image_processing_backends.py#L96-L132","documentation":"Error \"only a single or a list of entries is supported but got type={type(image_url_or_urls)}\" thrown in huggingface/transformers.","triggerScenarios":"Raised in image processing fetch path when image_url_or_urls is neither a single string/URL nor a list.","commonSituations":"Passing a tuple, dict, or nested structure of image URLs to an image processor backend.","solutions":["Pass a single image URL/path or a list of them.","Wrap iterables that are not lists into a list first."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a597f974857b3d92939971296bc0deb93d33d780","analyzedAt":"2026-08-14T18:24:08.354Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}