Spaces:
Runtime error
Runtime error
fix
Browse files
app.py
CHANGED
@@ -1,15 +1,18 @@
|
|
1 |
import gradio as gr
|
2 |
import requests
|
3 |
from PIL import Image
|
4 |
-
URL="https://source.unsplash.com/random/500x500/?nature,fruit"
|
|
|
5 |
|
6 |
def refresh():
|
7 |
image = Image.open(requests.get(URL, stream=True).raw)
|
8 |
return image
|
9 |
|
|
|
10 |
with gr.Blocks(show_footer=False) as blocks:
|
11 |
image = gr.Image(show_label=False)
|
12 |
-
blocks.load(fn=refresh, inputs=None, outputs=image,
|
|
|
13 |
|
14 |
blocks.queue(api_open=False)
|
15 |
-
blocks.launch()
|
|
|
1 |
import gradio as gr
|
2 |
import requests
|
3 |
from PIL import Image
|
4 |
+
URL = "https://source.unsplash.com/random/500x500/?nature,fruit"
|
5 |
+
|
6 |
|
7 |
def refresh():
|
8 |
image = Image.open(requests.get(URL, stream=True).raw)
|
9 |
return image
|
10 |
|
11 |
+
|
12 |
with gr.Blocks(show_footer=False) as blocks:
|
13 |
image = gr.Image(show_label=False)
|
14 |
+
blocks.load(fn=refresh, inputs=None, outputs=image,
|
15 |
+
show_progress=False, every=1)
|
16 |
|
17 |
blocks.queue(api_open=False)
|
18 |
+
blocks.launch()
|