Description
Describe the bug
Example caching does not work inside gr.render()
because the Examples/Interface code is not executed at runtime. The fix would be that if the cached example does not exist, it should be cached when the user clicks on the example (similar to lazy caching). However, we should make sure that if an Examples is re-rendered, the cached examples are not used since the function to generate those Examples may have changed.
Have you searched existing issues? 🔎
- I have searched and found no existing issues
Reproduction
import gradio as gr
with gr.Blocks() as demo:
@gr.render()
def cached_interface():
gr.Interface(lambda x:x, "textbox", "textbox", examples=["abc"], cache_examples=True)
demo.launch()
Screenshot
No response
Logs
System Info
gradio==5.16
Severity
I can work around it