Sometimes arbitrarily, I get an inference error with some of the examples in my gradio app

Hi!

First of all, to the Gradio team, thanks for the excellent library!

I built an image classifier app with gradio, and sometimes arbitrarily, I get an inference error with some of the examples in my app.

The app space: Croupier Creature App - a Hugging Face Space by alkzar90

Any advice to get some logging information or to debug better to catch this behavior?

Best,
Cristóbal

Hi @alkzar90 , I see you’ve disable the cache_examples. I don’t get any errors testing your app. It might be still related to the this Add image examples using Gradio "API mode" - #4 by alkzar90 maybe @freddyaboulton can help?

Hi @alkzar90!

Did you check the logs on the machine running the space? There is a See logs button right next to the logging status.

My guess is that you’re being rate limited. You can verify because the logs will say something like Cannot complete request to Huggingface API. If this is the case, passing an api_token to Interface.load should help if that’s the case.

In general though, anything you print (you can also use logger.log) from your prediction function will be logged to the Docker logs working on the machine.

There are open issues around providing clearer error messages, see 956 and 2014. If they would be relevant to you, please comment on them so that we know how to prioritize!