radames commited on
Commit
279529f
1 Parent(s): 7452731
Files changed (1) hide show
  1. app.py +6 -3
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, show_progress=False, queue=False, every=1, show_api=False)
 
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()