Issue with Example Code in Hugging Face Space - Gradio AppError for Photo Restoration
Hi everyone,I’m unsuccessfully trying to use an image restoration on an Hugging Face shared space from API.working with the example code provided in theHugging Face space for Old Photo Restorationusinggradio_client.Following theexample exactly as it’s shown in the space, I’m running into this error:AppError: The upstream Gradio app has raised an exception but has not enabled verbose error reporting. To enable, set show_error=True in launch().Interestingly, the model works without issues when run directly on the Hugging Face space UI online, but calling it via the API consistently returns this error.Here’s the code I’m using (directly from the example provided):from gradio_client import Client

client = Client("https://modelscope-old-photo-restoration.hf.space/--replicas/l754q/")
result = client.predict(
    "https://raw.githubusercontent.com/gradio-app/gradio/main/test/test_files/bus.png",  # filepath for 'image' Image component
    api_name="/predict"
)
print(result)I’ve triedIncluding an HF tokenin theClientconstructor to ensure it isn’t an authorization issueI’ve triedUsing a local file pathfor the image instead of a URL.I’ve tried also loading the base64 of the image getting the same error.It outputsLoaded as API: https://modelscope-old-photo-restoration.hf.space/--replicas/l754q/ ✔
AppError: The upstream Gradio app has raised an exception but has not enabled verbose error reporting. To enable, set show_error=True in launch().and it takes about 5 seconds to get the error.Has anyone else experienced this issue with Gradio API calls? Are there additional configuration settings we may need for successful remote calls, or a way to enable verbose error reporting to get more insights on what’s going wrong?
2024-11-14T00:38:11Z
As the error message says, the author of Spaces has turned off debug messages, so we don’t know the exact cause.However, that error often occurs when the version of Gradio used in the Space is different from the version of Gradio installed on your local machine.Please try matching the version of Gradio on your local machine to the version used in the Space.huggingface.colevihsu/OOTDiffusion · The Gradio API isn't working.The Gradio API is giving error when trying to predict using the gradio client. It seems that the gradio app errors out whenever accessed via the given api definition. Should there be a change in th...pip install -U gradio