diff --git a/gradio/components/image.py b/gradio/components/image.py index cd42f0909090c..45ee88e0a2856 100644 --- a/gradio/components/image.py +++ b/gradio/components/image.py @@ -249,7 +249,7 @@ def postprocess( elif isinstance(y, _Image.Image): path = processing_utils.save_pil_to_cache(y, cache_dir=self.GRADIO_CACHE) elif isinstance(y, (str, Path)): - path = y if isinstance(y, str) else str(y) + path = str(y) else: raise ValueError("Cannot process this value as an Image") return FileData(name=path, data=None, is_file=True)