amgad59 commited on
Commit
a83f4fe
·
1 Parent(s): ed08816

Update run.py

Browse files
Files changed (1) hide show
  1. run.py +7 -4
run.py CHANGED
@@ -5,6 +5,10 @@ import random
5
 
6
  import gradio as gr
7
 
 
 
 
 
8
 
9
  def fake_gan():
10
  images = [
@@ -19,8 +23,7 @@ def fake_gan():
19
  ), f"label {i}" if i != 0 else "label" * 50)
20
  for i in range(3)
21
  ]
22
- return images
23
-
24
 
25
  with gr.Blocks() as demo:
26
  with gr.Column(variant="panel"):
@@ -34,11 +37,11 @@ with gr.Blocks() as demo:
34
  container=False,
35
  )
36
  btn = gr.Button("Generate image").style(full_width=False)
37
-
38
  gallery = gr.Gallery(
39
  label="Generated images", show_label=False, elem_id="gallery"
40
  ).style(grid=[2], height="auto")
41
-
42
  btn.click(fake_gan, None, gallery,api_name='testing')
43
 
44
  if __name__ == "__main__":
 
5
 
6
  import gradio as gr
7
 
8
+ examples = [
9
+ ["examples/vermeer.jpg", 3, 1, 25, 0],
10
+ ["examples/matisse.jpg", 3, 1, 25, 0],
11
+ ]
12
 
13
  def fake_gan():
14
  images = [
 
23
  ), f"label {i}" if i != 0 else "label" * 50)
24
  for i in range(3)
25
  ]
26
+ return examples
 
27
 
28
  with gr.Blocks() as demo:
29
  with gr.Column(variant="panel"):
 
37
  container=False,
38
  )
39
  btn = gr.Button("Generate image").style(full_width=False)
40
+
41
  gallery = gr.Gallery(
42
  label="Generated images", show_label=False, elem_id="gallery"
43
  ).style(grid=[2], height="auto")
44
+
45
  btn.click(fake_gan, None, gallery,api_name='testing')
46
 
47
  if __name__ == "__main__":