fix error on runtime at line 135 `gradio.Example`
Browse filestry fix ```ValueError("If caching examples, `fn` and `outputs` must be provided")```
app.py
CHANGED
|
@@ -134,13 +134,16 @@ with gr.Blocks(css=css) as demo:
|
|
| 134 |
|
| 135 |
gr.Examples(
|
| 136 |
examples = examples,
|
| 137 |
-
|
|
|
|
|
|
|
|
|
|
| 138 |
)
|
| 139 |
|
| 140 |
run_button.click(
|
| 141 |
fn = infer,
|
| 142 |
inputs = [prompt, negative_prompt, seed, randomize_seed, width, height, guidance_scale, num_inference_steps],
|
| 143 |
-
outputs = [result]
|
| 144 |
)
|
| 145 |
|
| 146 |
demo.queue().launch()
|
|
|
|
| 134 |
|
| 135 |
gr.Examples(
|
| 136 |
examples = examples,
|
| 137 |
+
fn = infer,
|
| 138 |
+
inputs = [prompt],
|
| 139 |
+
outputs = [result, seed],
|
| 140 |
+
cache_examples="lazy"
|
| 141 |
)
|
| 142 |
|
| 143 |
run_button.click(
|
| 144 |
fn = infer,
|
| 145 |
inputs = [prompt, negative_prompt, seed, randomize_seed, width, height, guidance_scale, num_inference_steps],
|
| 146 |
+
outputs = [result, seed]
|
| 147 |
)
|
| 148 |
|
| 149 |
demo.queue().launch()
|