gradio-app / gradio

Build and share delightful machine learning apps, all in Python. 🌟 Star to support our work!
http://www.gradio.app
Apache License 2.0
32.24k stars 2.41k forks source link

`cache_examples` does not work with streaming audio use-cases #5828

Open Vaibhavs10 opened 11 months ago

Vaibhavs10 commented 11 months ago

Describe the bug

In audio streaming use-cases like: https://huggingface.co/spaces/reach-vb/xtts-streaming

If we set cache_examples to True (which is the default on spaces) - It throws exceptions on yield.

Is the behaviour for caching different from that of non-streaming use-cases?

Have you searched existing issues? 🔎

Reproduction

set cache_examples = False and it'll run fine on this space: https://huggingface.co/spaces/reach-vb/xtts-streaming

Screenshot

No response

Logs

No response

System Info

Spaces with Gradio `sdk` = 3.44.3

Severity

I can work around it

freddyaboulton commented 11 months ago

Do you remember the error you got? It should work I remember we modified the examples class directly to handle streaming audio examples. The expected behavior is to play the entire audio

Vaibhavs10 commented 11 months ago

The error said, that one of the keys agree is missing. Which is not true since we pass it along. My understanding is that because of the loop after the first loop, it again expects all the initial variables to be passed to it.