yangrk commited on
Commit
b6c1afd
·
verified ·
1 Parent(s): 17cbb54

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -8
app.py CHANGED
@@ -1,12 +1,20 @@
1
  import gradio as gr
 
 
2
 
3
- description = "Story generation with GPT-2"
4
- title = "Generate your own story"
5
- examples = [["Adventurer is approached by a mysterious stranger in the tavern for a new quest."]]
 
 
 
 
 
 
6
 
7
- interface = gr.Interface.load("huggingface/pranavpsv/gpt2-genre-story-generator",
8
- # description=description,
9
- # examples=examples
10
- )
11
 
12
- interface.launch()
 
 
 
 
 
1
  import gradio as gr
2
+ import numpy as np
3
+ import time
4
 
5
+ def fake_diffusion(steps):
6
+ rng = np.random.default_rng()
7
+ for i in range(steps):
8
+ time.sleep(1)
9
+ image = rng.random(size=(600, 600, 3))
10
+ yield image
11
+ image = np.ones((1000,1000,3), np.uint8)
12
+ image[:] = [255, 124, 0]
13
+ yield image
14
 
 
 
 
 
15
 
16
+ demo = gr.Interface(fake_diffusion,
17
+ inputs=gr.Slider(1, 10, 3, step=1),
18
+ outputs="image").queue()
19
+
20
+ demo.launch()