use gradio python api with error: None

#2
by watermoon-misaka - opened

hi, I try to call the ByteDance/AnimateDiff-Lightning gradio api with python, but when I try to run

result = client.predict(
        "geek",	# str  in 'Prompt (English)' Textbox component
        "ToonYou",	# Literal['ToonYou', 'epiCRealism']  in 'Base model' Dropdown component
        "",	# Literal['', 'guoyww/animatediff-motion-lora-zoom-in', 'guoyww/animatediff-motion-lora-zoom-out', 'guoyww/animatediff-motion-lora-tilt-up', 'guoyww/animatediff-motion-lora-tilt-down', 'guoyww/animatediff-motion-lora-pan-left', 'guoyww/animatediff-motion-lora-pan-right', 'guoyww/animatediff-motion-lora-rolling-anticlockwise', 'guoyww/animatediff-motion-lora-rolling-clockwise']  in 'Motion' Dropdown component
        "1",	# Literal['1', '2', '4', '8']  in 'Inference steps' Dropdown component
        api_name="/generate_image"
)

something was error. the error text is None, all traceback is below:

Traceback (most recent call last):
  File "/Users/bytedance/code_reader/hugging_face/text2video.py", line 4, in <module>
    result = client.predict(
  File "/Users/bytedance/.pyenv/versions/3.9.13/lib/python3.9/site-packages/gradio_client/client.py", line 466, in predict
    return self.submit(
  File "/Users/bytedance/.pyenv/versions/3.9.13/lib/python3.9/site-packages/gradio_client/client.py", line 1480, in result
    return super().result(timeout=timeout)
  File "/Users/bytedance/.pyenv/versions/3.9.13/lib/python3.9/concurrent/futures/_base.py", line 446, in result
    return self.__get_result()
  File "/Users/bytedance/.pyenv/versions/3.9.13/lib/python3.9/concurrent/futures/_base.py", line 391, in __get_result
    raise self._exception
  File "/Users/bytedance/.pyenv/versions/3.9.13/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/Users/bytedance/.pyenv/versions/3.9.13/lib/python3.9/site-packages/gradio_client/client.py", line 1108, in _inner
    predictions = _predict(*data)
  File "/Users/bytedance/.pyenv/versions/3.9.13/lib/python3.9/site-packages/gradio_client/client.py", line 1217, in _predict
    raise ValueError(result["error"])
ValueError: None

It seems that this is the api return None, Is that support gradio python api?

Sign up or log in to comment