pngwn / gradio-imageslider

ImageSlider custom component for gradio.
https://huggingface.co/spaces/pngwn/gradio_imageslider
30 stars 5 forks source link

'ImageSlider' object has no attribute 'pil_to_temp_file' #17

Open not-lain opened 7 months ago

not-lain commented 7 months ago

replication

all code can be found here : https://colab.research.google.com/drive/1fKhbUJzkIUL09RYGhWdkHEJ8lv8OcHUr?usp=sharing

logs

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/gradio/queueing.py", line 522, in process_events
    response = await route_utils.call_process_api(
  File "/usr/local/lib/python3.10/dist-packages/gradio/route_utils.py", line 260, in call_process_api
    output = await app.get_blocks().process_api(
  File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 1739, in process_api
    inputs = self.preprocess_data(fn_index, inputs, state, explicit_call)
  File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 1462, in preprocess_data
    processed_input.append(block.preprocess(inputs_cached))
  File "/usr/local/lib/python3.10/dist-packages/gradio_imageslider/imageslider.py", line 172, in preprocess
    return self._preprocess_image(x.root[0]), self._preprocess_image(x.root[1])
  File "/usr/local/lib/python3.10/dist-packages/gradio_imageslider/imageslider.py", line 160, in _preprocess_image
    return self._format_image(im)
  File "/usr/local/lib/python3.10/dist-packages/gradio_imageslider/imageslider.py", line 140, in _format_image
    path = self.pil_to_temp_file(
AttributeError: 'ImageSlider' object has no attribute 'pil_to_temp_file'

environment

gradio_imageslider : 0.0.18
gradio : 4.25.0
not-lain commented 7 months ago

I think we should separate the input type and the output type here since my input is a filepath and my output is a pil image.