API text only not working

#56
by cbg342 - opened

Hello, I keep trying the third example of the API documentation exactly as it's written, and getting an error. The other examples work fine.
Here is the code I'm running:


client = Client("https://facebook-musicgen.hf.space/")
result = client.predict(
                "Howdy!",	# str  in 'parameter_15' Dataset component
                fn_index=2
)
print(result)

And here's the error:

  File "/Users/cameronglass/opt/anaconda3/lib/python3.9/site-packages/gradio_client/client.py", line 836, in _predict
    output = result["data"]
KeyError: 'data'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/cameronglass/opt/anaconda3/lib/python3.9/site-packages/gradio_client/client.py", line 291, in predict
    return self.submit(*args, api_name=api_name, fn_index=fn_index).result()
  File "/Users/cameronglass/opt/anaconda3/lib/python3.9/site-packages/gradio_client/client.py", line 1125, in result
    return super().result(timeout=timeout)
  File "/Users/cameronglass/opt/anaconda3/lib/python3.9/concurrent/futures/_base.py", line 446, in result
    return self.__get_result()
  File "/Users/cameronglass/opt/anaconda3/lib/python3.9/concurrent/futures/_base.py", line 391, in __get_result
    raise self._exception
  File "/Users/cameronglass/opt/anaconda3/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/Users/cameronglass/opt/anaconda3/lib/python3.9/site-packages/gradio_client/client.py", line 798, in _inner
    predictions = _predict(*data)
  File "/Users/cameronglass/opt/anaconda3/lib/python3.9/site-packages/gradio_client/client.py", line 842, in _predict
    if "error" in result and "429" in result["error"] and is_public_space:
TypeError: argument of type 'NoneType' is not iterable

Any ideas? Thank you

  • Cam

Sign up or log in to comment