Unable to inference from space in python using API

adityaqqa
Sat, 26 Oct 2024 06:17:35 +0000

I want to inference via API using gradio_client from https://huggingface.co/spaces/jadechoghari/ferret-demo. I have been unable to do it as I get the following error.
python3.11/site-packages/gradio_client/client.py", line 885, in _get_config raise ValueError(f"Could not fetch config for {self.src}") ValueError: Could not fetch config for https://huggingface.co/spaces/jadechoghari/ferret-demo/

Following is the python code I’m executing:

from gradio_client import Client, handle_file

client = Client("https://huggingface.co/spaces/jadechoghari/ferret-demo")
result = client.predict(
		chatbot=[],
		image_data=handle_file(image_path),
		prompt=prompt,
		model_path="jadechoghari/Ferret-UI-Gemma2b",
		temperature=0.2,
		top_p=0.7,
		max_new_tokens=512,
		api_name="/inference_with_gradio"
)
print(result)