Spaces:
Running
on
Zero
help !!!! how to query the app via API
i try to fellow API documentation KingNish/OpenGPT-4o , but it doesn't work
from gradio_client import Client, file
client = Client("KingNish/OpenGPT-4o")
result = client.predict(
audio=file('https://github.com/gradio-app/gradio/raw/main/test/test_files/audio_sample.wav'),
web_search=False,
api_name="/predict"
)
print(result)
bug show as below :
Loaded as API: https://kingnish-opengpt-4o.hf.space ✔
ValueError Traceback (most recent call last)
in <cell line: 4>()
2
3 client = Client("KingNish/OpenGPT-4o")
----> 4 result = client.predict(
5 audio=file('https://github.com/gradio-app/gradio/raw/main/test/test_files/audio_sample.wav'),
6 web_search=False,
2 frames
/usr/local/lib/python3.10/dist-packages/gradio_client/client.py in predict(self, api_name, fn_index, *args, **kwargs)
459 "Cannot call predict on this function as it may run forever. Use submit instead."
460 )
--> 461 return self.submit(
462 *args, api_name=api_name, fn_index=fn_index, **kwargs
463 ).result()
/usr/local/lib/python3.10/dist-packages/gradio_client/client.py in submit(self, api_name, fn_index, result_callbacks, *args, **kwargs)
503
504 if isinstance(endpoint, Endpoint):
--> 505 args = utils.construct_args(endpoint.parameters_info, args, kwargs)
506
507 helper = None
/usr/local/lib/python3.10/dist-packages/gradio_client/utils.py in construct_args(parameters_info, args, kwargs)
1110 if parameters_info is None:
1111 if kwargs:
-> 1112 raise ValueError(
1113 "This endpoint does not support key-word arguments Please click on 'view API' in the footer of the Gradio app to see usage."
1114 )
ValueError: This endpoint does not support key-word arguments Please click on 'view API' in the footer of the Gradio app to see usage.