radames commited on
Commit
384402c
1 Parent(s): c61b6f3

cache examples

Browse files
Files changed (2) hide show
  1. .gitignore +2 -1
  2. app.py +5 -2
.gitignore CHANGED
@@ -2,4 +2,5 @@ venv/
2
  .DS_Store
3
  out/
4
  __pycache__/
5
- *.pth
 
 
2
  .DS_Store
3
  out/
4
  __pycache__/
5
+ *.pth
6
+ gradio_cached_examples/
app.py CHANGED
@@ -94,6 +94,9 @@ with gr.Blocks() as blocks:
94
  warped = gr.Image(label="Suggested Undo")
95
  run_btn.click(fn=predict, inputs=[in_image], outputs=[
96
  label, cropped, heatmap, warped])
97
- gr.Examples(fn=predict, examples=list(Path("./examples").glob("*.png")), inputs=[in_image], outputs=[
98
- label, cropped, heatmap, warped])
 
 
 
99
  blocks.launch()
 
94
  warped = gr.Image(label="Suggested Undo")
95
  run_btn.click(fn=predict, inputs=[in_image], outputs=[
96
  label, cropped, heatmap, warped])
97
+ gr.Examples(fn=predict,
98
+ examples=list(Path("./examples").glob("*.png")),
99
+ inputs=[in_image],
100
+ outputs=[label, cropped, heatmap, warped],
101
+ cache_examples=True)
102
  blocks.launch()